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.

Illustrative mockup for ubuntu-26-04-lts โ€” post-185-2
Illustrative mockup – Progressive Robot โ€” Illustrative mockup โ€” Progressive Robot

Environment & Reproduction

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

Illustrative mockup for ubuntu-26-04-lts โ€” post-185-2
Illustrative mockup – Progressive Robot โ€” Illustrative mockup โ€” Progressive Robot

Root Cause Analysis

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

Illustrative mockup for ubuntu-26-04-lts โ€” post-185-2
Illustrative mockup – Progressive Robot โ€” Illustrative mockup โ€” Progressive Robot

Quick Triage

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

Illustrative mockup for ubuntu-26-04-lts โ€” post-185-2
Illustrative mockup – Progressive Robot โ€” Illustrative mockup โ€” Progressive Robot

Step-by-Step Diagnosis

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

Illustrative mockup for ubuntu-26-04-lts โ€” post-185-1
Illustrative mockup – Progressive Robot โ€” Illustrative mockup โ€” Progressive Robot

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.

Illustrative mockup for ubuntu-26-04-lts โ€” post-185-2
Illustrative mockup – Progressive Robot โ€” Illustrative mockup โ€” Progressive Robot

Solution – Alternative Approaches

Use ssh-copy-id to install keys safely and reduce manual permission mistakes.

Illustrative mockup for ubuntu-26-04-lts โ€” post-185-2
Illustrative mockup – Progressive Robot โ€” Illustrative mockup โ€” Progressive Robot

Verification & Acceptance Criteria

ssh login succeeds with key and no password prompt. Logs show accepted publickey entries.

Illustrative mockup for ubuntu-26-04-lts โ€” post-185-2
Illustrative mockup – Progressive Robot โ€” Illustrative mockup โ€” Progressive Robot

Rollback Plan

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

Illustrative mockup for ubuntu-26-04-lts โ€” post-185-2
Illustrative mockup – Progressive Robot โ€” Illustrative mockup โ€” Progressive Robot

Prevention & Hardening

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

Illustrative mockup for ubuntu-26-04-lts โ€” post-185-2
Illustrative mockup – Progressive Robot โ€” Illustrative mockup โ€” Progressive Robot

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.

Illustrative mockup for ubuntu-26-04-lts โ€” post-185-2
Illustrative mockup – Progressive Robot โ€” Illustrative mockup โ€” Progressive Robot

References & Further Reading

OpenSSH sshd_config documentation and Ubuntu OpenSSH server administration guide.

Illustrative mockup for ubuntu-26-04-lts โ€” post-185-2
Illustrative mockup – Progressive Robot โ€” Illustrative mockup โ€” Progressive Robot

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.