29 January 2011

chage coMMand

You can use the chage command to manage the expiration date of a password. Password aging information is stored in the /etc/shadow file. In order, the columns in /etc/shadow are shown in Table. The associated chage switch, where available, is shown with each description entry. For example, if you wanted to require that user test1 keep a password for at least two days, use the chage test1 -m 2 command.


Table: The Anatomy of /etc/shadow
Column
Field
Description
1
Username
Username
2
Password
Encrypted password; requires an x in the second column of /etc/passwd
3
Password history
Date of the last password change, in number of days after January 1, 1970
4
mindays
Minimum number of days that you must keep a password (-m)
5
maxdays
Maximum number of days after which a password must be changed (-M)
6
warndays
Number of days before password expiration when a warning is given (-W)
7
inactive
Number of days after password expiration when an account is made inactive (-I)
8
disabled
Number of days after password expiration when an account is disabled (-E)




biOos

No comments: