Fix SSH "connection refused", "timed out" and "permission denied"
Work out what each SSH error means, test the port from your computer, and use the control panel's browser console to fix the firewall, the SSH service or key permissions.
- Intermediate
- Linux VPS
- 3 min read
SSH errors look alike, but each points to a different cause. Read the exact message first, then follow the matching section.
What the error means
- Connection timed out: your packets get no answer. The server is off, the IP or port is wrong, or a firewall silently drops the traffic.
- Connection refused: the server answered, but nothing listens on that port. SSH is stopped or runs on another port.
- Permission denied (publickey,password): SSH works; the server rejected your user, password or key.
- REMOTE HOST IDENTIFICATION HAS CHANGED: the server's key differs from the one your computer saved.
1. Check the basics
- In the client area, open Services and confirm the server is running. Start it if it is stopped.
- Compare the IP address with the one on your service page, character by character.
- If you changed the SSH port, connect with
ssh -p <port>. - Try another network, such as a phone hotspot. Some office, school and public Wi-Fi networks block outgoing SSH.
2. Test the port from your computer
On Windows PowerShell:
Test-NetConnection 203.0.113.25 -Port 22On macOS or Linux:
nc -vz 203.0.113.25 22TcpTestSucceeded : True or succeeded means the port is reachable and the problem is the login itself (go to section 4).
3. Fix it from the browser console
The browser console works without SSH. Click Open Control Panel on your service page, open the console and log in as root. Then check, in order:
systemctl status ssh --no-pager # Ubuntu / Debian (use sshd on AlmaLinux / Rocky)
sudo sshd -t
sudo ss -tlnp | grep -i ssh- If SSH is stopped,
sshd -ttells you which config line is broken. Fix it, thensystemctl restart ssh(orsshd). - If
ssshows a port other than the one you used, connect to that port.
Then check the firewall and Fail2ban:
sudo ufw status # Ubuntu / Debian
sudo firewall-cmd --list-all # AlmaLinux / Rocky
sudo fail2ban-client status sshd # if Fail2ban is installedAllow your SSH port if it is missing, and unban your IP with sudo fail2ban-client set sshd unbanip <your-ip>.
A completely full disk can stop services from starting. If df -h shows 100% on /, see Free up disk space on Linux.
4. Permission denied
Run SSH in verbose mode and look at which keys are offered and rejected:
ssh -v [email protected]- Use the right user:
rooton a fresh server, or the user you created. - Point at the right key:
ssh -i ~/.ssh/id_ed25519 [email protected]. - On the server, fix key permissions for that user:
chmod 700 /home/alex/.ssh
chmod 600 /home/alex/.ssh/authorized_keys
chown -R alex:alex /home/alex/.sshIf password logins are disabled and you lost your key, add a new public key to authorized_keys from the browser console.
5. Host key changed
After an OS reinstall this is expected. Remove the saved key and reconnect:
ssh-keygen -R 203.0.113.25If you did not reinstall or change anything, do not accept the new key. Open a support ticket first.
Still stuck?
Do not reinstall the server just to regain access; a reinstall erases everything. Open a support ticket with the exact error, the time you tried, and the output of ssh -vvv (it contains no passwords). Never paste a password or private key into a ticket.
Next steps
Was this guide helpful?
Still stuck?
Ask RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.
Related guides
Troubleshooting
Fix Nginx 413 Request Entity Too Large
Nginx returns 413 Request Entity Too Large when an upload is bigger than client_max_body_size. Raise the limit for one site or the whole server, match PHP's limits, and test.
- Beginner
- Linux VPS
- 5 min read
Troubleshooting
Is your ISP or router blocking port 12230? How to tell
Work out whether your internet provider, home router, parental controls or a proxy is blocking RDP port 12230, and collect the details support needs to help.
- Intermediate
- Windows VPS · Admin RDP
- 5 min read
Troubleshooting
Fix "Your credentials did not work" in Remote Desktop
Fix rejected RDP logins: username format, the right password, stale saved credentials, account lockout and Remote Desktop permissions.
- Beginner
- Windows VPS · Admin RDP
- 3 min read