Affected versions: Ubuntu 20.04 LTS

📖 ~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 key login fails and falls back to password or access denial.

Environment & Reproduction

Ubuntu 20.04 user account migrated or copied from another system.

Root Cause Analysis

Insecure ownership or mode on home, .ssh, or authorized_keys is rejected.

Quick Triage

Use ssh -vvv from client and inspect auth.log on the server.

Step-by-Step Diagnosis

Audit file modes, ownership, and sshd config directives for key auth.

Illustrative mockup for ubuntu-20-04-lts — ssh_permissions_diag
sshd rejects key login because of insecure file permissions — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Set strict permissions, correct ownership, reload sshd, and retest login.

Still having issues? Our IT Consulting team can diagnose and resolve this for you. Get in touch for a free consultation.

Illustrative mockup for ubuntu-20-04-lts — ssh_permissions_fixed
Home and authorized_keys permissions corrected for key auth — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Use centralized key management with controlled provisioning workflows.

Verification & Acceptance Criteria

Public key authentication succeeds without interactive password prompts.

Rollback Plan

Restore prior SSH config backup if policy enforcement causes lockout.

Prevention & Hardening

Automate permissions checks and disable password auth where possible.

PAM restrictions and Fail2ban bans can mask key-auth troubleshooting.

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

OpenSSH security and file permission requirements on Ubuntu.

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.