The need to check the status of password for an account comes if you have a habit of locking user account based on certain criteria. In another scenario, if have received requests from employees that have their user accounts expired. This scenario occurs if you have an Organization policy of locking user account for certain number of sequential login failures or if an account is unused for certain period.

To check the status of password of an account, you need to use “passwd” command as shown below.

[root@techpulp ~]# passwd -S mark
mark PS 2009-01-21 0 99999 7 -1 (Password set, unknown crypt variant.)
[root@techpulp ~]#

The above status indicates that the user account “mark” is active and needs no unlocking.

Now let us see what “passwd” command says for a locked account “neo“.

[root@techpulp ~]# passwd -S neo
neo LK 2010-08-25 0 99999 7 -1 (Password locked.)
[root@techpulp ~]#

Now let us see what “passwd” command says for a passwordless account “liz“.

[root@techpulp ~]# passwd -S liz
liz NP 2010-08-25 0 99999 7 -1 (Empty password.)
[root@techpulp ~]#

From the above, you can confirm that the user account “neo” is locked out.

Must Read:

How to lock and unlock an account in Linux

How to create passwordless account in Linux system