Change password expiry in Linux

“chage” is the command to list & change the password aging information for Linux user account. The chage command changes the number of days between password expiry and the current date. Here’s a real quick on how to show the expiration date of a particular linux user account.

Listing password aging for user:

This user’s last password change was on Dec 25th 2017 and it expires in 90 days. The user will be notified within login 7 days before expiry.


Change the number of days to expire:

Use -M option and provide the number of days for expiry.


Change the password to never expire:

You can use chage to make the password never expire with the below options. This sets password and the account to never expire.


Leave a Reply