π ~1 min read
Table of contents
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'

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

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 Errors & Cross-Refs
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.