How to change the password Aging Policies in Linux?
This article, will clearly explains how to change the password Aging Policies in Linux.
In Linux, we can change the password policies in 2 ways.
(i) First open the /etc/login.defs file and modify the current values.
Example: # vim /etc/login.defs
min – 0: means the user can change the password to any no. of times.
min – 2: means the user can change the password within 2 days. ie., he can change the password after 2 days.
max – 5: means the user should change the password before or after 5 days. Otherwise the password will be expired after 5 days.
inactive – 2: means after password expiry date the grace period another 2 days will be given to change the password.
warning – 7: means a warning will be given to the user about the password expiry 7 days before expiry date.
(ii) second by executing the # chage command.
Example: # chage <options><user name>
The options are, -d –> last day
-E –> expiry date
-I –> inactive days
-l –> list all the policies
-m –> min. days
-M –> max. days
-w –> warning days
Note : Whenever we change the password aging policy using #chage command, the information is will be modified in /etc/shadow file.