|
Windows hosts, whether server or client, the relevant user account and password information may have their own set. How long expired, how often to change your password reminder. So in the great CentOS Linux 6.0 operating system also has such way. Then the following we look at this mode of operation and examples. Of course, this article only mentions one mode of operation, that is, use the chage operate the way, in fact, still there are a lot of ways, as we talk about the future I will use to modify the configuration file in which to achieve the desired effect. /etc/login.defs and / etc / default / useradd CentOS system to improve the security level.
See examples. The following use root for the relevant tests and view the desired effect.
[Root @ localhost ~] # chage
Usage: chage [options] [LOGIN]
Options:
-d, --lastday LAST_DAY set date of last password change to LAST_DAY
-E, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-h, --help display this help message and exit
-I, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-l, --list show account aging information
-m, --mindays MIN_DAYS set minimum number of days before password
change to MIN_DAYS
-M, --maxdays MAX_DAYS set maximim number of days before password
change to MAX_DAYS
-W, --warndays WARN_DAYS set expiration warning days to WARN_DAYS
To view the current changes have not been root account information.
[Root @ localhost ~] # chage -l root
Last password change: Jul 30, 2011
Password expires: never
Password inactive: never
Account expires: never
Minimum number of days between password change: 0
Maximum number of days between password change: 99999
Number of days of warning before password expires: 7
[Root @ localhost ~] # chage -m 1 -M 60 -W 5 root
Set the corresponding root information
[Root @ localhost ~] #chage -m 1 -M 60 -W 5 root
See root after the effective date, with the original information corresponding contrast. Significant changes
[Root @ localhost ~] # chage -l root
Last password change: Jul 30, 2011
Password expires: Sep 28, 2011
Password inactive: never
Account expires: never
Minimum number of days between password change: 1
Maximum number of days between password change: 60
Number of days of warning before password expires: 5
See whether the entry into force, and the associated account information
[Root @ localhost home] # passwd -S root
root PS 2011-07-29 1 60 5 -1 (Password set, SHA512 crypt.) |
|
|
|