Check how old a Linux password is using chage

I came across a command today that I’ve never really had a use for before.  chage can be used to check when a password was last modified and also shows any password expiration rules etc.  It can also be used to implement password expiration. A very useful tool if password policies are required, although PAM is probably the best thing to use.

chage -l username
Last password change : Jan 29, 2010
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7

Force user to change password when they next log in:
chage -d 0 username

You can leave a response, or trackback from your own site.

Leave a Reply