Você pode usar o comando passwd
:
# passwd -S
root P 11/04/2014 -1 -1 -1 -1
# passwd -l root
passwd: password expiry information changed.
# passwd -S
root L 11/04/2014 -1 -1 -1 -1
# passwd -d root
passwd: password expiry information changed.
# passwd -S
root NP 11/04/2014 -1 -1 -1 -1
De man 1 passwd
:
-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.
Os dados mostrados são armazenados em /etc/shadow
, o arquivo que contém as senhas criptografadas.
Por exemplo, após cada um dos comandos passwd
acima, os estados eram:
1:root:$............long hash...............::::::
1:root:!$........same long hash.............:16478::::::
1:root::16478::::::