π ~1 min read
Table of contents
Symptom & Impact
Administrators lose remote access, delaying incident response and requiring console fallback for routine operational changes.
Environment & Reproduction
Appears after key rotation, user migration, strict security hardening, or accidental ownership changes on home and SSH directories.
Root Cause Analysis
sshd rejects auth when key files, authorized_keys paths, account policy, or daemon settings violate expected security constraints.
Quick Triage
Confirm account status and test with verbose SSH output to isolate key mismatch, policy denial, or server-side configuration issues.
Step-by-Step Diagnosis
Inspect sshd logs, validate ~/.ssh permissions, and test effective daemon config to identify the exact rejection reason.

Solution – Primary Fix
Repair ownership and mode bits, correct sshd_config directives, reload daemon, and revalidate key-based login from trusted clients.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
Use emergency password auth with MFA controls, out-of-band management channels, or temporary bastion relays for controlled recovery.
Verification & Acceptance Criteria
Accept success when key login works consistently, brute-force protections remain active, and audit logs show expected authentication paths.
Rollback Plan
Restore known-good sshd configuration snapshot and prior authorized_keys metadata if new hardening introduces operational lockouts.
Prevention & Hardening
Automate permission checks, enforce config linting pre-deploy, and include SSH reachability tests in post-change validation pipelines.
Related Errors & Cross-Refs
Related issues include PAM account lockouts, fail2ban bans, and host key mismatch warnings covered in companion access tutorials.
Related tutorial: View the step-by-step tutorial for Ubuntu 20.04 LTS.
View all Ubuntu 20.04 LTS tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Read OpenSSH manual pages, Ubuntu SSH hardening recommendations, and incident response guides for secure remote administration.
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.