The chage command 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. The /etc/login.defs file defines the site-specific configuration for the shadow password suite including password aging configuration. To disable password aging, enter:
chage -M 99999 userName
To get password expiration information, enter:
chage -l userName
You can also manually specify the information in the /etc/shadow file which has the following fields
{userName}:{password}:{lastpasswdchanged}:{Minimum_days}:{Maximum_days}:{Warn}:{Inactive}:{Expire}:
Note that the “Expire” date is in Unix Time (seconds since Jan 1, 1970)
The chage command is usually easier than manually editing the /etc/shadow file.
chage –M 60 –m 7 –W 7 <accountname>
No comments:
Post a Comment