📖 ~1 min read
Table of contents
Symptom & Impact
SSH daemon does not start, causing complete remote access outage.
Environment & Reproduction
Occurs after editing `sshd_config` or replacing host keys.
sudo systemctl restart ssh
Root Cause Analysis
Invalid sshd directives, key file permissions, or missing host keys block startup.
Quick Triage
Validate ssh configuration before restarting service.
sudo sshd -t
Step-by-Step Diagnosis
Inspect ssh service logs and key file ownership.
sudo journalctl -u ssh --since -1h && ls -l /etc/ssh/ssh_host_*

Solution – Primary Fix
Correct config syntax or regenerate host keys, then restart ssh.
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

Solution – Alternative Approaches
Restore prior known-good `sshd_config` from backup.
Verification & Acceptance Criteria
`systemctl status ssh` is active and new SSH sessions connect successfully.
Rollback Plan
Revert to previous ssh configuration and keys if auth issues appear.
Prevention & Hardening
Always run `sshd -t` in deployment pipelines before restarting daemon.
Related Errors & Cross-Refs
Related to UFW ingress denies and cloud security group misconfiguration.
Related tutorial: View the step-by-step tutorial for Ubuntu 24.04 LTS.
View all Ubuntu 24.04 LTS tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Ubuntu OpenSSH server hardening and recovery documentation.
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.