check_latest_version && sudo apt update && sudo apt upgrade -y
Verify SSH is running:
sudo systemctl status ssh
sudo systemctl start ssh
sudo systemctl enable ssh
Check network and port:
telnet hostname 22
nmap -p 22 hostname
ssh -v user@hostname
Allow SSH through firewall:
sudo ufw allow ssh
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
SSH daemon is not running, firewall blocking, or wrong port/credentials.
ss -tlnp | grep :22
journalctl -u ssh
cat /etc/ssh/sshd_config