Skip to content

Posts tagged ‘password’

How to check when was the last time any local user password was changed in Unix?

How to check when was the last time any local user password was changed in Unix?

When ever any local user account password is changed the file /etc/shadow is updated.
So, if you want to check when was the last time any local user password was changed then just run:

[root@TestServer ~]# ls -lrt /etc/shadow
-r——– 1 root root 1035 Oct 11 11:11 /etc/shadow

From above output, its clear that last time any local user password was changed was on 11th Oct of this year.

For example, if you want to see when was the last time root user password was changed, just run below command:

[root@TestServer ~]# chage -l root
Last password change : Oct 11, 2016
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : -1
Maximum number of days between password change : -1
Number of days of warning before password expires : -1