π ~1 min read
Table of contents
Symptom & Impact
Administrative commands fail because sudo authentication stack errors out.
Environment & Reproduction
Often follows manual edits in /etc/pam.d or auth package changes.
sudo -l
su -
sudo cat /etc/pam.d/sudo
Root Cause Analysis
Invalid PAM module lines, missing packages, or malformed include directives.
Quick Triage
Check auth logs and validate sudoers syntax separately from PAM.
sudo visudo -c
sudo tail -n 120 /var/log/auth.log
ls -l /etc/pam.d
Step-by-Step Diagnosis
Audit PAM include chain and missing module dependencies.
grep -R '^@include' /etc/pam.d -n
dpkg -l | grep libpam
sudo journalctl -t sudo -n 80

Solution – Primary Fix
Restore default PAM file for sudo and reinstall required PAM modules.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo cp /usr/share/pam-configs/* /tmp 2>/dev/null || true
sudo apt install --reinstall -y libpam-runtime libpam-modules
sudo pam-auth-update --force

Solution – Alternative Approaches
Use root console access to replace damaged files from backup directly.
cp /etc/pam.d/sudo.bak /etc/pam.d/sudo
Verification & Acceptance Criteria
sudo prompts and authenticates normally for permitted users.
sudo -k
sudo -l
sudo id
Rollback Plan
Revert to prior PAM stack backup if new module set conflicts with policy.
sudo cp /etc/pam.d/sudo.prechange /etc/pam.d/sudo
sudo pam-auth-update
Prevention & Hardening
Restrict direct PAM edits and validate auth changes through controlled workflow.
sudo debsums libpam-runtime | head
sudo visudo -c
Related Errors & Cross-Refs
Related to locked root account, expired passwords, and NSS lookup issues.
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
Ubuntu PAM and sudo authentication documentation.
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.