📖 ~1 min read
Table of contents
Symptom & Impact
SSH clients refuse connection due to strict host key mismatch warning.
Environment & Reproduction
Ubuntu 24.04 hosts reprovisioned or rebuilt with regenerated host keys.
Root Cause Analysis
Client known_hosts stores prior key fingerprint that no longer matches rebuilt server identity.
Quick Triage
Verify host identity out-of-band before accepting any new host key fingerprint.
ssh-keygen -F server.example.com; ssh-keyscan -t ed25519 server.example.com
Step-by-Step Diagnosis
Confirm server fingerprints directly from console and compare with client warning details.
sudo ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub; ssh -vvv [email protected]

Solution – Primary Fix
Remove stale known_hosts entry and add verified current key fingerprint.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
ssh-keygen -R server.example.com && ssh [email protected]

Solution – Alternative Approaches
Distribute host certificates via SSH CA to avoid per-host fingerprint drift issues.
Verification & Acceptance Criteria
SSH connects without warnings and fingerprint matches approved asset inventory.
Rollback Plan
Reinstate old host key only if rebuild is reverted and old image restored.
Prevention & Hardening
Integrate host key lifecycle management in provisioning and CMDB workflows.
Related Errors & Cross-Refs
Related to man-in-the-middle concerns and stale DNS inventory records.
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
OpenSSH manual pages and Ubuntu secure access 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.