At least in shadow-utils 4.1.5.1 on Arch Linux, I have -a
, which also prints the status. passwd -Sa
appears to do what you want. From man passwd
:
-a, --all
This option can be used only with -S and causes show status for all users.
-S, --status
Display account status information. The status information consists
of 7 fields. The first field is the user's login name. The second
field indicates if the user account has a locked password (L), has
no password (NP), or has a usable password (P). The third field
gives the date of the last password change. The next four fields
are the minimum age, maximum age, warning period, and inactivity
period for the password. These ages are expressed in days.
# passwd -Sa
root P 05/07/2013 -1 -1 -1 -1
bin P 09/19/2010 -1 -1 -1 -1
daemon P 09/19/2010 -1 -1 -1 -1
mail P 09/19/2010 -1 -1 -1 -1
ftp P 09/19/2010 -1 -1 -1 -1
http P 09/19/2010 -1 -1 -1 -1
uuidd P 09/19/2010 -1 -1 -1 -1
dbus P 09/19/2010 -1 -1 -1 -1
nobody P 09/19/2010 -1 -1 -1 -1
git L 05/07/2013 -1 -1 -1 -1
chris P 05/07/2013 0 99999 7 -1
avahi L 05/07/2013 -1 -1 -1 -1
mpd L 05/07/2013 -1 -1 -1 -1
ntp L 05/07/2013 0 99999 7 -1
nullmail L 05/13/2013 -1 -1 -1 -1
polkitd L 05/14/2013 0 99999 7 -1
cut
method seems reasonable and safe to me. – mrb May 14 '13 at 18:15chage -l <user>
, looping through the/etc/passwd
8-). – slm♦ May 14 '13 at 18:38