Linux: HowTo Check User Password Expiration Date and Time

by on May 5, 2012 · 2 comments· LAST UPDATED May 5, 2012

in

/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
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 2 comments… read them below or add one }

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

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

Reply

2 REally? May 22, 2013 at 7:15 am

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

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , ,

Previous Faq:

Next Faq: