SSH won’t connect
A step-by-step breakdown: from “connection timed out” to “access denied” — how to understand where exactly the break is and restore access via the panel console.
Updated August 23, 2026
Losing SSH looks the same every time, but there are five causes, and they're fixed differently. Start with the error message — it immediately narrows the search. The main thing: you always have access to the machine through the “Console” tab in the panel /hosting/vds/m/<id>; it works independently of the network and settings inside the system.
Reading the error
| Message | Where the break is |
|---|---|
Connection timed out | packets don't arrive: the machine is off, a filter, wrong address |
Connection refused | the machine responds, but no one is listening on the port: the sshd service isn't running |
Permission denied (publickey) | the network is fine, the key didn't match |
Permission denied (password) | the password didn't match or password login is disabled |
Host key verification failed | the machine's fingerprint changed — usually after a reinstall |
It's useful to look at the details: ssh -vvv root@YOUR_ADDRESS will show at which stage things got stuck.
Timed out
- Check the machine's status on the “Overview” tab. If the graphs have stopped, the machine isn't running — turn it on or reboot it from the panel.
- Make sure the address is correct and that you can reach the machine at all:
ping YOUR_ADDRESS. - Log in through the console and check the filter:
ss -tulpn | grep sshd
nft list ruleset | head -40 # or iptables -S
ufw status # Debian, Ubuntu
firewall-cmd --list-all # AlmaLinux, CentOS Stream
The classic case — you ran ufw enable without allowing port 22. It's fixed with one command from the console: ufw allow 22/tcp.
- Check whether fail2ban is blocking you after failed attempts:
fail2ban-client status sshd; to unban —fail2ban-client set sshd unbanip YOUR_IP.
Connection refused
The service isn't running or is listening on a different port.
systemctl status sshd || systemctl status ssh
journalctl -u sshd -n 50 --no-pager
sshd -t # check configuration for errors
systemctl restart sshd
sshd -t saves the day most often: a single typo in /etc/ssh/sshd_config prevents the service from starting after a restart. If you changed the port, connect with -p NUMBER and don't forget to allow it in the filter.
Permission denied
If you get a key error, check on the machine:
ls -la /root/.ssh
chmod 700 /root/.ssh && chmod 600 /root/.ssh/authorized_keys
grep -E 'PermitRootLogin|PubkeyAuthentication|PasswordAuthentication' /etc/ssh/sshd_config
If the permissions are stricter than allowed, sshd will silently refuse. The key list in the panel on the “Access” tab is replaced entirely: when adding a new key, don't accidentally delete a working one. Saving the list reboots a running machine, so edit it entirely and once.
Forgot the root password — look it up on the “Access” tab; it's stored encrypted and shown by clicking a button. If you changed the password inside the system, the panel doesn't know about it: either log in through the console and change it with the passwd command, or click “Change password” — the panel will issue a new one and reboot the machine.
Host key verification failed
After reinstalling the system, the fingerprint changes. Remove the old entry on your side:
ssh-keygen -R YOUR_ADDRESS
If there was no reinstall, don't confirm the new fingerprint blindly — verify it through the console: ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub.
When nothing helped
Boot the machine into recovery mode: “Access” tab → boot mode → SystemRescue disk. The machine starts from the image, root login without a password, your disk is visible as /dev/sda. Mount it and edit the configuration:
mount /dev/sda1 /mnt
nano /mnt/etc/ssh/sshd_config
Then return to normal boot mode and reboot the machine.
Before changing SSH settings, open a second session and keep it open. If the new configuration locks you out, you'll fix it through the old connection without bringing up the console.