Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # www.fduran.com
- # Check which Linux users could log in with password, see "man shadow" for the second field in the /etc/shadow file:
- # "If the password field contains some string that is not a valid result of crypt(3), for instance ! or *, the user will not be able to use a unix password to log in (but the user may log in the system by other means).
- # this awk one-liner will find users that have common used * or ! in the password field or field starts with ! (locked account). It's possible that still found user cannot log in due to other character
- awk -F: '$2 != "*" && $2 !~ /^!/ { print $1, " can log in" }' /etc/shadow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement