Wednesday, July 6, 2011

passwd oneliner - Locked user account listing

A quick one to get a list of user accounts that are locked out:

passwd -S -a | awk '/LK/{print $1}'

Pretty straightforward but must be run as root.