How to set Linux password aging using chage command
Password aging is a mechanism that allows the Linux system to enforce a certain lifetime for passwords and this is a good security practice.
Password aging information can be configured with the Linux chage command. If the chage command is immediately followed by a username, the administrator will be interactively prompted for the password aging values.
Option |
Description |
-m days |
Specify the minimum number of days between which the user must change passwords. If the value is 0, the password does not expire. |
-M days |
Specify the maximum number of days for which the password is valid. |
-d days |
Specify the number of days since January 1, 1970 the password was changed. |
-I days |
Specify the number of inactive days after the password expiration before locking the account. If the value is 0, the account is not locked after the password expires. |
-E date |
Specify the date on which the account is locked, in the format YYYY-MM-DD. Instead of the date, the number of days since January 1, 1970 can also be used. |
-W days |
Specify the number of days before the password expiration date to warn the user. |