π ~1 min read
Table of contents
Symptom & Impact
Remote administration is unavailable because sshd is down or misconfigured.
Environment & Reproduction
Appears after config edits, key permission changes, or package updates.
cat /etc/os-release
systemctl status ssh --no-pager
ss -ltnp | grep ':22'
Root Cause Analysis
Syntax errors, invalid directives, or host key issues prevent daemon startup.
Quick Triage
Validate sshd config and inspect service journal logs.
sudo sshd -t
sudo journalctl -u ssh -n 100 --no-pager
ls -l /etc/ssh/ssh_host_*
Step-by-Step Diagnosis
Check auth settings, port binding, and key permissions.
grep -E '^(Port|ListenAddress|PasswordAuthentication|PubkeyAuthentication)' /etc/ssh/sshd_config
sudo namei -l /home/*/.ssh 2>/dev/null | head
ss -ltnp | grep sshd

Solution – Primary Fix
Fix config errors, regenerate missing host keys, and restart ssh service.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo ssh-keygen -A
sudo sshd -t
sudo systemctl restart ssh
sudo systemctl enable ssh

Solution – Alternative Approaches
Temporarily open alternate port if port 22 is occupied or blocked.
echo 'Port 2222' | sudo tee -a /etc/ssh/sshd_config
sudo systemctl restart ssh
sudo nft add rule inet filter input tcp dport 2222 accept
Verification & Acceptance Criteria
Service is active and SSH login succeeds from management host.
systemctl is-active ssh
ssh -v localhost
Rollback Plan
Restore prior sshd_config from backup if login regressions occur.
sudo cp /root/sshd_config.bak /etc/ssh/sshd_config
sudo systemctl restart ssh
Prevention & Hardening
Use config testing before restart and maintain out-of-band access.
sudo sshd -t
sudo systemctl reload ssh
Related Errors & Cross-Refs
Related messages include bad configuration option and no hostkeys available.
Related tutorial: View the step-by-step tutorial for Debian 13.
View all Debian 13 tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
OpenSSH server configuration and Debian SSH hardening guides.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β we respond within one business day.