≡ 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?

{ 2 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

Leave a Comment