SSH: Permission Denied
Error: `Permission denied (publickey,password)`
This error indicates credentials were not accepted.
Possible causes and solutions
Wrong password: Verify you're using the correct password. Remember SSH passwords are case-sensitive.
Wrong user:
# Try with root
ssh root@IP
# Or with the correct username
ssh ubuntu@IP
ssh debian@IP
Password authentication disabled: If the server is configured to accept only SSH keys, you can't login with password. Use the private key:
ssh -i ~/.ssh/id_ed25519 root@IP
Error: `Connection refused`
SSH port is not reachable.
Verify if SSH service is active (from VNC Console in panel):
systemctl status sshd
systemctl start sshd
Verify if firewall blocks SSH port:
ufw status
iptables -L -n | grep 22
Verify SSH is listening on the right port:
ss -tlnp | grep ssh
Error: `Connection timed out`
Server not responding on SSH port.
Try with correct port if it was changed:
ssh -p NEW_PORT root@IP
- Firewall blocking the port
- SSH port was changed
- Server is unreachable (see Server Unreachable)
Error: `Host key verification failed`
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
This happens when server was reinstalled or IP was reassigned. The host key changed and SSH alerts you for security.
Solution: delete the old key:
ssh-keygen -R SERVER_IP
# If port is different from 22
ssh-keygen -R [SERVER_IP]:PORT
Error: `Too many authentication failures`
SSH client tried too many keys. Specify the correct one:
ssh -o IdentitiesOnly=yes -i ~/.ssh/id_ed25519 root@IP
Error: `No route to host`
Network problem between your computer and the server. Check:
ping SERVER_IP
traceroute SERVER_IP
If ping works but SSH doesn't, the problem is on port 22.
Don't remember password and don't have SSH keys
If you can't access in any way:
- Use VNC Console from control panel
- If VNC console doesn't work either, start Rescue Mode
- Follow the guide: Reset Root Password
Advanced SSH debug
To see what happens during connection:
ssh -vvv root@IP
The detailed output shows exactly where and why the connection fails.
Articoli correlati
Locked Out of VPS
Complete guide to recover server access when locked out, with step-by-step instructions from VNC Console
Server Unreachable
What to do when server is not responding or you can't connect via SSH
Website Not Reachable
What to do when website is not responding, shows errors, or is unreachable
