≡ Menu

Linux: HowTo Check User Password Expiration Date and Time

/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
Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 3 comments… add one }

  • David Ramirez April 25, 2013, 1:59 pm

    Is there a way to list just the expiration date ? (or any of the other specific fields reported by chage ?)

    • REally? May 22, 2013, 7:15 am

      Really? just grep it or awk with a pipe… easy enough

  • Jerry Ursetti June 11, 2015, 7:13 pm

    Is it possible to get the time in addition to the date. On AIX, the password expiration warning includes the date and time. My password will expire tomorrow. It would be helpful to know what time it will expire so that I can determine how much time I’ll have tomorrow before it expires? If it’s going to expire early in the day, I may want to change it today. If it expires late in the day I may wait until tomorrow morning.

    Thanks.

    Jerry

Leave a Comment