Getting started
How to connect to a Linux server with SSH
Log in to a new VPS or dedicated server from Windows, macOS or Linux, then switch from passwords to SSH keys.

SSH is how you talk to a Linux server: an encrypted terminal session between your computer and the machine. This guide takes you from the access details in your client area to a passwordless, key-based login. The examples use 203.0.113.10 as the server address; replace it with yours.
What you need
- The IP address of your server, from the Services page of your client area.
- The username, normally
rooton a new server. - The password shown on the same page. You will replace it in a few minutes.
Connect for the first time
macOS, Linux and Windows 10 or 11 all ship with an SSH client. Open Terminal (or PowerShell on Windows) and run:
ssh root@203.0.113.10
The first time, SSH shows the server’s fingerprint and asks whether to continue. Type yes. From then on your computer remembers the server and warns you if its identity ever changes. Enter the password when asked; nothing appears on screen as you type, which is normal.
On an older Windows? Install PuTTY, enter the IP address in “Host Name”, keep port 22 and click Open.
Switch to SSH keys
A password can be guessed; a key cannot, in any practical sense. A key pair has two halves: a private key that stays on your computer, and a public key that you place on the server.
1. Create a key on your computer
ssh-keygen -t ed25519 -C "my-laptop"
Press Enter to accept the default location. A passphrase is optional but recommended: it protects the key if your computer is stolen.
2. Copy the public key to the server
On macOS and Linux:
ssh-copy-id root@203.0.113.10
On Windows PowerShell, which has no ssh-copy-id:
type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh root@203.0.113.10 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
3. Test it
ssh root@203.0.113.10
You should get a shell without being asked for the server password.
Turn password logins off
Once the key works, close the door that bots are knocking on. On the server:
echo "PasswordAuthentication no" > /etc/ssh/sshd_config.d/10-keys-only.conf
sshd -t && systemctl restart ssh
On AlmaLinux and Rocky Linux the service is called sshd instead of ssh.
Keep your current session open and test the login from a second terminal before you close it. If something is wrong you can still fix it.
A shortcut for next time
Add an entry to ~/.ssh/config on your computer:
Host myserver
HostName 203.0.113.10
User root
IdentityFile ~/.ssh/id_ed25519
From now on, ssh myserver is enough. The same name works with scp, rsync and most editors.
When it does not work
| Message | Usual cause | Fix |
|---|---|---|
Connection timed out | Wrong IP address, or a firewall in between | Check the address; try from another network |
Connection refused | The server is still starting, or SSH is not running | Wait a minute and retry |
Permission denied (publickey) | The server does not have your public key | Repeat step 2, or log in from the computer that has the key |
REMOTE HOST IDENTIFICATION HAS CHANGED | You reinstalled the server, so its fingerprint is new | ssh-keygen -R 203.0.113.10, then connect again |
Next step
You are logged in as root with a key. Before installing anything, spend fifteen minutes on the basics: updates, a normal user and a firewall. That is the subject of Secure a new Linux server in 15 minutes.
Sources and further reading
Read nextTwo guides to follow this one.
All getting started guides
Getting startedHow to connect to a Windows RDP serverOpen a remote desktop session from Windows, macOS, Linux, iPhone or Android, and fix the usual connection errors.
Privacy and policyDMCA takedowns explained, and what DMCA-ignored hosting meansHow a DMCA notice works, why hosts suspend first and ask later, and what “DMCA-ignored” hosting does and does not cover.
Your own server, in a few minutes.
Cloud VPS from $3.99 a month: no email, no ID, crypto payment, root access in minutes.
- No KYCNo email, no ID
- No DMCANotices not acted on
- Crypto friendlyBTC, ETH, XMR, USDT, SOL
- UnmeteredOn every plan