Affected versions: 26.04

📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

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.

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.