SSH Troubleshooting
Cheat sheet · https://pcornel.dk/topic.php?topic=2808
Answer
SSH troubleshooting follows the connection step by step: name resolution and TCP 22, key exchange, host key verification, user authentication, then account/PAM and the session.
Remember
"Connection timed out" → network or firewall; "Connection refused" → nothing listening; host key warning → verify before accepting; "Permission denied (publickey)" → key, permissions or AllowUsers. The server journal gives the real reason.
First checks
ssh -vvv user@host— client steps and where it stopsjournalctl -u sshd -u ssh -e— server-side reasonss -ltnp | grep :22— sshd listeningsshd -T— effective server policy
Commands
systemctl reload sshd
Verify in this order
DNS → TCP 22 → key exchange → host key trusted → user authenticated → account/PAM → shell
Where it usually breaks
First mismatch in link/interface → address/namespace → route/neighbor → firewall/policy → socket/daemon → DNS/TLS/SSH/application peer path; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2808