📖 ~1 min read
Table of contents
Symptom & Impact
SSH prompts for password or denies login even when valid private key is supplied, breaking automation and remote administration.
Environment & Reproduction
Ubuntu 16.04 OpenSSH servers after home directory permission changes or edited sshd_config.
Root Cause Analysis
StrictModes checks fail due to insecure permissions/ownership, wrong AuthorizedKeysFile path, or disabled PubkeyAuthentication.
Quick Triage
Use ssh -vvv from client and inspect server logs with journalctl -u ssh or /var/log/auth.log.
Step-by-Step Diagnosis
Validate ownership and modes on home, .ssh, and authorized_keys, then test effective sshd configuration with sshd -T.

Solution – Primary Fix
Set secure permissions (700 .ssh, 600 authorized_keys), correct sshd_config auth settings, and restart ssh service safely.
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 centralized SSH certificate authentication or configuration management to enforce canonical authorized_keys placement.
Verification & Acceptance Criteria
Key-based login succeeds without password and sshd logs show accepted publickey for expected user/key fingerprint.
Rollback Plan
Restore previous sshd_config and authorized_keys backups; keep console session open while reverting to avoid lockout.
Prevention & Hardening
Automate file permission checks, enable fail2ban/rate limits, and audit SSH config drift regularly.
Related Errors & Cross-Refs
Related to UFW SSH blocks, DNS host mismatch warnings, and PAM/account policy denials.
Related tutorial: View the step-by-step tutorial for Ubuntu 16.04 LTS.
View all Ubuntu 16.04 LTS tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
sshd_config(5), ssh(1), and secure remote access hardening baselines.
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.