πŸ“– ~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

Users without keys cannot log in, causing urgent access incidents for operations teams.

Environment & Reproduction

Ubuntu 24.04 nodes with cloud-init or hardening scripts that modify sshd defaults.

Root Cause Analysis

Config includes override files setting PasswordAuthentication no or Match blocks restricting users.

Quick Triage

Use console access to confirm active sshd config and avoid remote lockout escalation.

sudo sshd -T | grep -E 'passwordauthentication|kbdinteractiveauthentication'

Step-by-Step Diagnosis

Inspect primary and drop-in sshd configs, then check auth logs for rejection reason.

grep -R 'PasswordAuthentication' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf; sudo journalctl -u ssh --since '2 hours ago'
Illustrative mockup for ubuntu-24-04-lts β€” ssh_password_auth_problem
SSH login denied because PasswordAuthentication is off β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Set intended auth policy, validate syntax, and reload ssh daemon safely from console session.

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

sudoedit /etc/ssh/sshd_config.d/99-local-auth.conf && sudo sshd -t && sudo systemctl reload ssh
Illustrative mockup for ubuntu-24-04-lts β€” ssh_password_auth_fix_success
sshd configuration corrected and validated β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Move to key-only access with emergency break-glass serial console runbook.

Verification & Acceptance Criteria

Expected auth method works and failed login noise returns to baseline.

Rollback Plan

Revert drop-in file and reload ssh if new auth policy blocks intended admin users.

Prevention & Hardening

Track sshd config with configuration management and preflight syntax checks.

Related to PAM restrictions and account lockout policy side effects.

Related tutorial: View the step-by-step tutorial for Ubuntu 24.04 LTS.

View all Ubuntu 24.04 LTS tutorials on the Tutorials Hub β†’

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

OpenSSH sshd_config man page and Ubuntu server security docs.

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.