How to check user's password status

Following command will give short information about the status of the password for a given user account. In the given example, I used an existing user Anil in the system.

 
1- When User account is Locked.
 
[ root @leolinux ~]#   passwd   -S    anil
 
anil   LK    2012-09-07   0   99999   7   -1  (Password locked.) 
 
anil                  -->   User Name
LK                    --->   Locked
2012-09-07   --> Last password change date
0                       -->   Minimum number of days between password changes
99999              -->  Maximum number of days the password is valid
7                     -->  Warn warn before days expire
-1                      -->    Inactive period
(Password locked.) --> Password is locked 
 
 
2- When User account password is not set.
 
[ root @leolinux ~]#   passwd   -S    anil
 
anil    NP    2012-11-19   0    99999   7   -1    (Empty password.) 
 
NP                    --->   No password
(Empty password.) --> Password is blank 
 

 3- When User account password is set and account is not locked.

[ root @leolinux ~]#   passwd   -S    anil
 
anil   PS   2012-09-07   0   99999   7   -1    (Password set, SHA512 crypt.)
 
PS   --->   Password Set
(Password set, SHA512 crypt) --> Password is set using SHA512 algorithm