/etc/shadow files stores actual password in encrypted format for user’s account. How do I check users password expiry information under Linux operating systems?
You need to use the chage command. It can display password expiry information as well as changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change his/her password.
View account again information:
To see account aging information such as expiry date and time, enter:
chage -l userNameHere
|
To see account aging info for vivek, enter:
$ chage -l vivek
Sample outputs:
Last password change : Jan 10, 2012 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
Another example:
$ chage -l raj
Sample outputs:
Last password change : May 21, 2012 Password expires : Jun 20, 2012 Password inactive : never Account expires : Jan 01, 2013 Minimum number of days between password change : 7 Maximum number of days between password change : 30 Number of days of warning before password expires : 7