Logins · about 3 minutes
Lock Accounts With No Password
What This Means
An account can log in with an empty password.
Why It Matters
Anyone who can reach a login prompt can use it without knowing anything.
- 1
Find accounts with no password
awk -F: '$2 == "" { print $1 }' /etc/shadow
- 2
Lock it
passwd -l locks the password. Set a real one instead with passwd demo if the account is needed.
passwd -l demo
- 3
Confirm none are left
No output means every account has a password or is locked.
awk -F: '$2 == "" { print $1 }' /etc/shadow; echo done
Check It’s Fixed
Run the security report again. This check should now pass.