Getting started

How to connect to a server via SSH: Windows, Mac and Linux

You connect to a Linux server with one command: in PowerShell on Windows, in Terminal on macOS and Linux, or through PuTTY. The IP address, username and password are in the ticket about your server’s delivery.

  • Time: 5 minutes
  • Level: Easy

In short

  • One command works on every system: ssh root@203.0.113.10, with your server’s IP instead of the example. On Windows 10 and 11 you type it in PowerShell, on macOS and Linux in Terminal.
  • The IP address, username and password are in the server delivery ticket. On Hetzner you log in as root, on OVH as a user named after the OS, such as ubuntu or debian.
  • On the first login, SSH asks whether to trust the server: type yes. The password does not show as you type, and that is expected.
  • After an OS reinstall, the REMOTE HOST IDENTIFICATION HAS CHANGED error is cleared with ssh-keygen -R 203.0.113.10.
Contents
  1. Where to find the IP address, username and password
  2. Connecting from Windows 10 and 11 with PowerShell
  3. Connecting with PuTTY
  4. Connecting from macOS and Linux
  5. How to tell that you are logged in to the server
  6. Logging in with an SSH key instead of a password
  7. If you cannot connect: SSH errors and what to do
  8. REMOTE HOST IDENTIFICATION HAS CHANGED after a reinstall
  9. FAQ

You will need

  • Your server’s IP address, username and password from the delivery ticket in the ABCD client area.
  • A computer with Windows 10 or 11, macOS or Linux. Usually there is nothing to install.
  • No server yet? See the dedicated server catalog.

This article is about Linux servers. Windows servers are reached via RDP: how to connect to a Windows server.

Where to find the IP address, username and password

When the server is ready, we tell you in a ticket in the ABCD client area: it contains the IP address, username and password. If you cannot find the ticket, message us on Telegram or create a new ticket, and we will tell you where the details are.

The username depends on the provider:

ProviderLog in asWhat to keep in mind
HetznerrootYou have administrator rights right away.
OVHclouda user named after the OS: ubuntu, debianRoot login over SSH is disabled. The sudo -i command gives you root rights; details in the article on logging in to an OVH server.

If the ticket says the Hetzner server is running the Rescue System, you will land in a temporary system for installing an OS: the prompt will show root@rescue. How to install an OS is covered in the article on reinstalling Linux on Hetzner.

If you reinstalled the system yourself, the password is no longer the one in the ticket. OVH e-mails new login details to the address of your OVH account. On Hetzner, a system installed with installimage has the same root password that Robot showed when you activated the Rescue System.

Connecting from Windows 10 and 11 with PowerShell

Windows 10 and 11 usually come with an SSH client already installed, so you do not need a separate program.

  1. Open PowerShell

    Right-click Start and choose Terminal (on Windows 10, Windows PowerShell). Alternatively, press Win + R, type powershell and press Enter.

  2. Enter the connection command

    Replace 203.0.113.10 with your server’s IP and root with the username from the ticket:

    ssh root@203.0.113.10

    If SSH on the server listens on a port other than the standard port 22, add the port number: ssh -p 2222 root@203.0.113.10.

  3. Type yes to save the server’s key

    On the first connection, SSH shows the server’s key fingerprint and asks whether to continue:

    The authenticity of host '203.0.113.10 (203.0.113.10)' can't be established.
    ED25519 key fingerprint is SHA256:…
    Are you sure you want to continue connecting (yes/no/[fingerprint])?

    Type yes in full and press Enter. Your computer saves the key in the known_hosts file and will not ask again for this server.

    How to check the fingerprint against the server itself

    You can compare the fingerprint with the one the server shows. Open the server’s screen through the Hetzner KVM console or IPMI on OVH, log in and run the command below. The SHA256 line must match the one SSH showed.

    ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
  4. Enter the password

    When the line root@203.0.113.10's password: appears, paste the password from the ticket and press Enter. Nothing shows as you type, not even asterisks: this is how SSH hides the password length. You can paste the password from the clipboard with a right-click or Ctrl + V.

If PowerShell replies The term 'ssh' is not recognized as the name of a cmdlet…, the OpenSSH client is turned off in Windows. Find PowerShell in the Start menu, right-click it, choose Run as administrator and run:

Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

The installation takes a minute or two. Then close PowerShell, open it again and try connecting once more.

Connecting with PuTTY

PuTTY is a free SSH program for Windows that is handy for keeping a list of servers. Download it only from the official PuTTY page: search results include fake sites with modified installers.

  1. Enter the server address

    In the Session section, enter the server’s IP in the Host Name (or IP address) field. Leave Port at 22 and the connection type at SSH. To avoid typing the address every time, enter a name under Saved Sessions and click Save.

  2. Click Open and accept the server’s key

    On the first connection, PuTTY shows the PuTTY Security Alert window with the key fingerprint. Click Accept so that PuTTY remembers the server.

  3. Enter the username and password

    At the login as: prompt, enter the username from the ticket, then the password. You paste text into the PuTTY window with a right-click; as in PowerShell, the password characters do not show.

Next time, open the server by double-clicking its name in the Saved Sessions list.

Connecting from macOS and Linux

macOS and Linux have a built-in SSH client. Open Terminal: on macOS, press Cmd + Space and type “Terminal”; on Ubuntu, press Ctrl + Alt + T. Enter the same command as in PowerShell:

ssh root@203.0.113.10

From here it works as on Windows: answer yes on the first login, then paste the password, which does not show as you type.

How to tell that you are logged in to the server

After login, the server usually shows a welcome message with the OS version, and the prompt changes to root@server:~# (for a regular user, ubuntu@server:~$). Everything you type now runs on the server. Two commands show where you are and who you are logged in as:

hostname
whoami

To log out, type exit or press Ctrl + D. Programs started from this window stop when you log out. To keep a program running without you, such as a game server, run it as a service or inside tmux.

Logging in with an SSH key instead of a password

With a key, the server lets you in without a password, and a key cannot be brute-forced. You create the key once on your computer and copy its public part to the server. One command creates a key in PowerShell, on macOS and on Linux:

ssh-keygen -t ed25519

When asked for the file path, press Enter; it is best to set a passphrase, so that a stolen key file is useless. Two files appear in your user’s .ssh folder: id_ed25519 is the private key, never send it to anyone, and id_ed25519.pub is the public key.

Copy the public key to the server, with your own username and IP. On macOS and Linux:

ssh-copy-id root@203.0.113.10

PowerShell has no ssh-copy-id command, so you send the key like this:

type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh root@203.0.113.10 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

The server asks for the password one last time; later logins use the key. On OVH you can also paste the public key when you reinstall the system, in the Your Public SSH key field, so that it is on the server right away (reinstalling in the OVHcloud Control Panel).

If you cannot connect: SSH errors and what to do

What SSH saysWhat it meansWhat to do
ssh: connect to host 203.0.113.10 port 22: Connection timed out
In PuTTY: Network error: Connection timed out
The server did not answer at all: it is off or still booting, the IP is wrong, or a network along the way blocks port 22 (this happens on office and guest Wi-Fi).Compare the IP with the ticket. After a reboot or reinstall, wait 5–10 minutes. Try connecting over mobile internet. If that does not help, see what to check if the server is not responding.
ssh: connect to host 203.0.113.10 port 22: Connection refused
In PuTTY: Network error: Connection refused
The server is online but rejects connections on port 22: the system is still installing or booting, or SSH runs on another port or is not running.Wait a few minutes and try again. If the SSH port was changed, specify it: ssh -p 2222 root@203.0.113.10. You can see what is happening on the server’s screen through the Hetzner KVM console or IPMI on OVH.
Permission denied, please try again., and after three attempts Permission denied (publickey,password).
In PuTTY: Access denied
The server did not accept the username or password.Check the username: on OVH it is ubuntu or debian, and the server will not let you in as root. Paste the password from the clipboard, with no trailing space. If the system was reinstalled, the password has changed: where to find the new one. To reset the password: on Hetzner, on OVH via Rescue mode.
Permission denied (publickey).The server accepts only keys, and SSH did not find a suitable key on your computer.Specify the key file explicitly: ssh -i ~/.ssh/id_ed25519 root@203.0.113.10. If you have no key, log in through the server console and add it.
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! and Host key verification failed.The server’s key has changed. This happens after an OS reinstall and after booting into Rescue.If you reinstalled the system yourself, remove the old key: ssh-keygen -R 203.0.113.10. Details are in the section below.
The term 'ssh' is not recognized as the name of a cmdlet, function, script file, or operable programThe OpenSSH client is not installed in Windows.Install it with one PowerShell command or connect with PuTTY.

If none of these fit, send us the full error text and the command you typed (without the password) in a ticket: they make it easier to see at which step the connection breaks.

REMOTE HOST IDENTIFICATION HAS CHANGED after a reinstall

After an OS reinstall, the server has a new key, but your computer remembers the old one. SSH sees the mismatch and refuses to connect:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
…
Host key verification failed.

If you reinstalled the system yourself or booted the server into Rescue, remove the old key from the list of known servers. The command also works in PowerShell on Windows:

ssh-keygen -R 203.0.113.10

Connect again: SSH asks about the new key as on the first login, and you answer yes. PuTTY needs no command: in the window warning about the key change, click Accept, and PuTTY saves the new key.

If you have not reinstalled anything or rebooted the server into Rescue, do not connect and do not enter your password. Message us on Telegram or in a ticket: we will check what is happening with the server.

FAQ

My OVH server will not let me in as root. Is that normal?
Yes. On OVH servers you log in as a user named after the OS, such as ubuntu or debian, and get root rights with sudo -i. Details in the article on logging in to an OVH server.
Why can’t I type my password?
You can, but SSH does not show the characters, not even asterisks. Paste the password and press Enter.
How do I upload files to the server?
Over SFTP with the same IP address, username and password, port 22: for example, in WinSCP or FileZilla. You can also send a single file with scp file.zip root@203.0.113.10:/root/.
Can I connect to a Windows server via SSH?
We deliver Windows servers with RDP access; the SSH server in Windows is not turned on by default. How to connect: RDP from a computer and a phone.

Did this guide help?

Questions?