SSH connection troubleshooting
Diagnose and fix SSH connection problems step by step.
5 min readยท๐ง Troubleshooting
SSH connection issues are the most common cause of backup failures. Work through these checks in order.
1. Verify the basics from your own machine
Before debugging VPS Snaps, confirm you can SSH to the server yourself:
ssh -p 22 -i ~/.ssh/your_key user@your-server-ipIf this fails, the problem is with your server or firewall โ not VPS Snaps.
2. Check that SSH is listening
# On the server
sudo ss -tlnp | grep sshd
# Should show: 0.0.0.0:22 or your custom port3. Check firewall rules
# UFW
sudo ufw status
# iptables
sudo iptables -L INPUT -n | grep 22If you're on a cloud provider, also check their security groups / firewall rules in their dashboard. These operate before UFW.
4. Verify authorized_keys
The public key for VPS Snaps must be in the correct authorized_keys file for the SSH user:
cat ~/.ssh/authorized_keys
# Permissions must be correct
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys5. Check SSH server logs
# Debian/Ubuntu
sudo journalctl -u ssh -n 50
# CentOS/RHEL
sudo journalctl -u sshd -n 50The SSH server log shows exactly why a connection was rejected โ look for 'Invalid user', 'Authentication failure', or 'Bad permissions'.