๐ ~1 min read
Table of contents
Symptom & Impact
SSH prompts for password even though keys were deployed, breaking automation and secure key-only access policies.

Environment & Reproduction
Appears after home directory permission changes, copied keys with wrong ownership, or modified sshd configuration.

Root Cause Analysis
sshd ignores keys when file ownership or permissions violate strict checks, or when PubkeyAuthentication is disabled.

Quick Triage
Test with ssh -vvv user@host and verify server settings using sudo sshd -T | grep -E ‘pubkeyauthentication|authorizedkeysfile’.

Step-by-Step Diagnosis
Inspect auth logs with journalctl -u ssh -n 100 and check ~/.ssh, ~/.ssh/authorized_keys ownership and mode bits.

Solution – Primary Fix
Apply chmod 700 ~/.ssh, chmod 600 ~/.ssh/authorized_keys, chown user:user recursively, then restart ssh service with sudo systemctl restart ssh.
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 ssh-copy-id to install keys safely and reduce manual permission mistakes.

Verification & Acceptance Criteria
ssh login succeeds with key and no password prompt. Logs show accepted publickey entries.

Rollback Plan
Temporarily allow password auth for recovery while correcting key setup, then disable it again.

Prevention & Hardening
Enforce key deployment through automation and periodic permission audits on user home directories.

Related Errors & Cross-Refs
Common messages: ‘Permission denied (publickey)’ and ‘Authentication refused: bad ownership or modes’.
Related tutorial: View the step-by-step tutorial for Ubuntu 26.04 LTS.
View all Ubuntu 26.04 LTS tutorials on the Tutorials Hub โ
Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading
OpenSSH sshd_config documentation and Ubuntu OpenSSH server administration guide.

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.