Docs / Troubleshooting / Resolving SSH Connection Problems

Resolving SSH Connection Problems

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 29 views · 1 min read

Common SSH Errors

Connection Refused

# Check if SSH is running
sudo systemctl status sshd

# Check listening port
ss -tlnp | grep ssh

# Check firewall
sudo ufw status
sudo iptables -L -n | grep 22

Connection Timeout

  • Verify the server IP is correct
  • Check if the server is reachable: ping server-ip
  • Ensure no firewall is blocking the port between you and the server
  • Try from a different network to rule out local ISP issues

Permission Denied

# Verbose output to see what's happening
ssh -vvv user@server-ip

# Check key permissions (must be strict)
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pub

# On the server, check authorized_keys
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh

Host Key Verification Failed

# This means the server key changed (reinstall or MITM)
# Remove old key
ssh-keygen -R server-ip

# Then reconnect and verify the new fingerprint

Broken Pipe / Connection Reset

Add to your local ~/.ssh/config:

Host *
    ServerAliveInterval 60
    ServerAliveCountMax 3

Was this article helpful?