Short answer: if SSH to your VPS fails, read the error first. A timeout or connection refused means SSH can't reach the server (still installing, stopped, wrong IP, or port 22 blocked), Permission denied means it reached it and the login failed, and REMOTE HOST IDENTIFICATION HAS CHANGED after a reinstall is fixed with ssh-keygen -R followed by the server's IP. For kex_exchange_identification: Connection reset by peer, test without your VPN and from another network, then restart the server from the dashboard and wait two minutes.
On our Linux VPS you log in as root on port 22, with the password from the server page: ssh [email protected] (use your own IP). A new server is ready 1 to 5 minutes after the payment confirms. Everything below works from macOS, Linux and Windows 10 or 11, where ssh is built into PowerShell and Terminal.
01Which SSH Error Do You Have?
| What you see | What it means | First thing to try |
|---|---|---|
Connection timed out | Nothing answers on port 22 | Is the server running? Is port 22 blocked? (fix 1) |
Connection refused | The server answers, but SSH isn't listening on that port | Wait for setup, check the port (fix 2) |
kex_exchange_identification: read: Connection reset by peer or Connection closed by remote host | The connection opened and was cut before the login | VPN, your network, a ban or an overloaded server (fix 3) |
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! | Your computer remembers a different key for this IP | ssh-keygen -R and the IP (fix 4) |
Permission denied (publickey,password) | The server rejected the login | Username, password, key (fix 5) |
| Login hangs or the shell freezes | Disk full or out of memory | Free space, restart (fix 6) |
To see where it fails, add -v: ssh -v [email protected]. The last lines before the error tell you how far the connection got.
021. "Connection Timed Out": Can You Reach Port 22?
A timeout means no answer at all. Check, in this order:
- 1Is the server ready and running? The server page should say ready and running. A Linux VPS needs 1 to 5 minutes after the payment confirms, and a few minutes after a reinstall.
- 2Is the IP right? Copy it from the server page instead of typing it.
- 3Did you add firewall rules? On the firewall card of the server page, rules are checked top to bottom and the first match wins. A block rule for port 22 above your allow rule, or an allow rule for an IP you no longer have, locks you out. Reset to default on the same card removes your rules.
- 4Is your own network blocking port 22? Office, school and hotel networks sometimes do. Try your phone's hotspot.
Test the port from your own computer:
# macOS / Linux
nc -vz 203.0.113.18 22# Windows PowerShell
Test-NetConnection 203.0.113.18 -Port 22"Succeeded" or "open" means the port is reachable and the problem is further along. A timeout means the server is off or something on the way blocks it.
032. "Connection Refused": Is SSH Listening on That Port?
Refused is a quick, active "no": the server is up, but nothing accepts connections on that port.
- Right after an order or reinstall, the system is still starting. Wait a minute and try again.
- Did you move SSH to another port? Then give it:
ssh -p 2222 [email protected]. - Did you edit
/etc/ssh/sshd_configor stop the service? A config error stopssshdfrom starting. If you still have a session open, runsshd -tto find the line, fix it, thensystemctl restart ssh(on AlmaLinux, Rocky and Fedora the service issshd). - Is it a Windows server? Windows RDP doesn't use SSH. Connect with Remote Desktop on port 3389 instead: How to connect.
043. "kex_exchange_identification: Connection Reset by Peer"
The full message is usually kex_exchange_identification: read: Connection reset by peer or kex_exchange_identification: Connection closed by remote host. The TCP connection opened, then something closed it before the two sides even exchanged keys. Your password isn't the problem yet: the login never started.
The server or something between you and it hung up before the login started. Find out which by changing one thing at a time.
- 1Turn off your VPN or proxy and try again. VPNs and some protocols that disguise traffic often break or cut SSH. If it works without the VPN, let the server's IP bypass it with split tunneling.
- 2Try another network. A phone hotspot is the quickest test. If SSH works there, your usual network or provider interferes.
- 3Wait a few minutes if you mistyped the password many times. If you installed fail2ban or a similar tool, it bans an IP after failed logins. A ban from another network shows the same error. Once in, check
fail2ban-client status sshdand unban yourself withfail2ban-client set sshd unbanip YOUR_IP. - 4Restart the server from the dashboard and wait two minutes. An
sshdthat ran out of memory or a server with a full disk often answers like this, and a restart brings it back to a known state. - 5Look at the server's log once you're in.
journalctl -u ssh -n 50(or-u sshd) shows why connections were dropped.
Every public server gets thousands of password guesses from bots. When too many unfinished logins are open at once, OpenSSH drops new ones until the count falls (its MaxStartups setting, 10:30:100 by default). That's why the error can come and go. Logging in with a key and allowing port 22 only from your IP on the firewall card makes the noise disappear.
054. "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!"
The first time you connect, your computer saves the server's host key in ~/.ssh/known_hosts. A reinstall creates a new system with a new key, so the next connection doesn't match and SSH stops with this warning. The same happens if an IP you used before now belongs to a different server.
If you just reinstalled, or the server is new, remove the old key and connect again:
ssh-keygen -R 203.0.113.18
ssh [email protected]Answer yes when SSH asks to trust the new key. ssh-keygen -R works the same in Windows PowerShell.
If ssh-keygen -R says "Host not found in known_hosts" but the warning stays:
- You use another port. The entry is saved with it:
ssh-keygen -R "[203.0.113.18]:2222". - You connect by a hostname, not the IP. Run it for that name too.
- Delete the line by hand. The warning names the file and the line, for example
Offending ED25519 key in /Users/you/.ssh/known_hosts:7. Open that file and delete line 7. - PuTTY keeps its own list. It shows a dialog with the new key; accept it there.
Clearing the old key fixes only this warning. If the next attempt ends in "Connection reset by peer", go to fix 3.
065. "Permission denied (publickey,password)"
The server is reachable and rejected the login.
- 1Use
rootas the username:ssh root@IP, not justssh IP, which sends the username of your own computer. - 2Paste the password from the server page. Nothing appears while you type or paste a password in a terminal; that's normal. Press Enter.
- 3Did you change the password or reinstall? A reinstall sets a new password, and the server page shows it. A password you changed yourself isn't on the server page.
- 4Logging in with a key? Point SSH at it:
ssh -i ~/.ssh/id_ed25519 root@IP. To test the password instead, add-o PubkeyAuthentication=no. - 5Did you turn off password logins (
PasswordAuthentication no) and lose your key? Then nobody can log in with a password. A reinstall is the way back in: it erases the disk and sets a new password on the server page. Ask support before you do it.
076. The Login Hangs or the Shell Freezes
A server whose disk is full or whose memory is used up often accepts the connection and then hangs, or drops you right after the login. Restart it from the dashboard, log in quickly and check:
df -h / # disk
free -m # memoryA full disk is the most common cause on 10 and 20 GB plans: Linux VPS Disk Full? Find and Free Space Safely.
08How Do You Avoid Locking Yourself Out?
Keep a second session open
while you change SSH or firewall settings, and test the change in a new window before you close the old one.
Run sshd -t before every restart
of the SSH service. It finds config errors without stopping your current session.
Keep the root password
from the server page somewhere safe even if you log in with a key.
Back up your key
A lost private key can't be recovered on our side or yours.
Allow port 22 from your IP only
on the firewall card, and remember Reset to default if your IP changes.
09SSH from a Phone
On iPhone and Android, install a free SSH app such as Termius, add the server's IP, the username root and the password from the server page. The server page in the dashboard shows the right steps for your device and has a copy button for the ssh command.
The connection to port 22 opened and was closed before the key exchange. Usually a VPN or your network cuts it, your IP is banned after failed logins, or the server is overloaded. Test without the VPN and from another network, then restart the server from the dashboard.
Run ssh-keygen -R followed by the server's IP, then connect again and accept the new key. For a custom port use ssh-keygen -R "[IP]:PORT".
The old entry is saved under a different name: with a port, under a hostname, or in another file. The warning names the file and line number; delete that line by hand.
root, with the password from the server page in the dashboard.
TCP port 22, unless you changed it on the server. Port 22 is for Linux VPS only. Windows RDP uses Remote Desktop on port 3389.
If password login is still on, log in with the root password from the server page and add a new key. If you turned password login off, a reinstall sets a new password but erases the disk. Ask support first.
- ssh connection reset by peer
- kex_exchange_identification
- remote host identification has changed
- ssh permission denied
- ssh connection refused
- ssh connection timed out
- cant ssh into vps