Linux – Extract dates from /etc/shadow

linuxshadowusers

The file /etc/shadow has a couple date fields that are expressed as the number of days since Jan 1, 1970. Is there an easy way using to get a list of users and the calendar date of the last password change, and the expiration?

Ref: man shadow(5)

Best Answer

chage -l <username>

Example Output:

Last password change                                    : Dec 17, 2015
Password expires                                        : Mar 16, 2016
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 7
Maximum number of days between password change          : 90
Number of days of warning before password expires       : 14
Related Question