管理Linux下账号和密码的有效期,需要使用chage命令,从字面看,应当是change age的缩写形式。
如下是chage命令的帮助信息。
chage -h
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
-R, --root CHROOT_DIR directory to chroot into
-W, --warndays WARN_DAYS set expiration warning days to WARN_DAYS
如果需要进一步了解使用方法的话,可以使用man命令查看帮助。
man chage
查看某用户的有效期,可以执行命令chage -l jackie。
如下是样例。
# chage -l jackie
Last password change : 3月 06, 2017
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
其它资料
若非注明,均为原创,欢迎转载,转载请注明来源:管理Linux下帐号和密码的有效期限