Know how to remove password expiry in a Linux system. This is helpful in setting app accounts that need non-expiry passwords to run.

Requirement :
To set never expire attribute on account password. Some applications/users are required to have the same password for a longer duration. This requires them to exit from the system-wide password expiry policy. So that those accounts can run a lifetime without the need of changing their passwords.
How to do it :
Check the account’s current policy.
# chage -l testuser Last password change : Sep 01, 2016 Password expires : Oct 04, 2016 Password inactive : never Account expires : never Minimum number of days between password change : 0 Maximum number of days between password change : 33 Number of days of warning before password expires : 7 |
Here the second line shows when the password is expiring post which user will be prompted to set a new password. Set password to never expire with below command
# chage -M -1 testuser |
Verify changes in the account. Note here in output, Password expires
field changed its value to never
.
# chage -l testuser Last password change : Sep 01, 2016 Password expires : never Password inactive : never Account expires : never Minimum number of days between password change : 0 Maximum number of days between password change : 33 Number of days of warning before password expires : 7 |
Share Your Comments & Feedback: