User & Group Management
Stop guessing if a user has a password set
🧩 The Challenge
Dealing with audit reports where you have to figure out which local accounts are technically locked versus just having a disabled password is a total nightmare. Nobody tells you that staring at the second field of /etc/shadow is just going to give you a headache.
💡 The Fix
There is a way to pull the status of every user account instantly using passwd without needing to grep through encrypted strings. It saves you from having to check /etc/passwd and /etc/shadow separately like some kind of sad manual labor bot.
passwd -S --all
⚙️ Why It Works
Passing the -S flag to passwd forces the utility to display the status of the account, specifically whether it has a password, is locked, or has no password at all. You get a clean list that tells you exactly who is actually accessible.
🚀 Pro-Tip: Pipe this into grep ‘ L ‘ to isolate only the accounts that are currently locked out by the system.
Linux Tips & Tricks | © ngelinux.com | 11/21/2026
