The Cybermatic Signal · Fix-it Guides · Devices · Linux
← All guides · Time to fix: 5 minutes per server · Linux
An account with an empty second field in /etc/shadow has no password at all — anyone who can reach a login prompt for that account gets in without being asked for credentials. This affects any Linux server or workstation where accounts were created manually, migrated from another system, or set up by a script that skipped the password step. Finding and locking the affected accounts takes under five minutes.
The fix, verified
Account with empty password hash
| Severity | critical · Linux |
| Or run | sudo awk -F: '($2==""){print $1}' /etc/shadow # then: sudo passwd -l <account> |
| Maps to | CIS Linux 6.2.1HIPAA 164.308(a)(5) |
Linux stores hashed passwords in /etc/shadow, one line per account. The second colon-delimited field holds the hash. When that field is completely empty — not a locked marker like '!' or '*', just nothing — the system treats it as 'no password required.' A user can type the account name at a login prompt and press Enter with no password and be granted a shell. On systems where SSH password authentication is enabled, the same is true over the network.
A realistic scenario: a developer spins up a test VM, creates a service account with 'useradd' but never sets a password, then that VM gets promoted to a production role without a full security review. The account sits there quietly. Anyone who discovers the username — through a leaked config file, a verbose error message, or simple guessing — can log in immediately with no further effort.
Run the following command as root or with sudo. It reads /etc/shadow and prints the name of every account whose password field is empty. No output means no affected accounts.
sudo awk -F: '($2==""){print $1}' /etc/shadow # then: sudo passwd -l <account>If you see any account names printed, treat each one as a critical finding. Note them down before you do anything else.
For each account name the command returned, lock the account immediately using passwd -l. Locking prepends a '!' to the password field, which prevents password-based login without deleting the account or its files.
There is no vendor UI for this — it is a direct file and command operation. The awk command reads /etc/shadow in place; the passwd -l command writes the lock marker. Both require root or sudo privileges.
Locking an account prevents password-based login but does not affect SSH key-based login or sudo rules that reference the account. If a service or cron job runs as that account and relies on su or sudo with a password prompt, locking will not break it. The one case to watch: if a script somewhere does 'su - <account>' and expects to succeed without a password because the hash was empty, that script will now fail. Audit your cron jobs and init scripts for any reference to the affected account names before and after locking. If a service account needs to run processes, it should already have its login shell set to /sbin/nologin or /bin/false — check with: grep <account> /etc/passwd.
Is this open in your environment?
Cybermatic checks for "Account with empty password hash" automatically — on every device, every day — and shows you the exact fix above next to each one it finds. The free scan takes about ten minutes and needs no credit card.
Run the free scan All guides →Part of The Cybermatic Signal. Written by the Cybermatic editorial agent from the configuration check Cybermatic runs for this setting (ID lin-empty-shadow) and reviewed before publication. The click path, command and caution in the fix card are the vendor's documented procedure as of 2026-10-30. Found an error? Write to info@cybermatic.ai.
BriefingIssuesFlashGuidesInsurance checkDomain checkSubscribe
Cybermatic.ai by Ironhawk Group · 9330 Lyndon B Johnson Fwy, Suite 900 · Dallas, TX 75243 · Privacy · cybermatic.ai