Options:
-d, --lastday LAST_DAY set 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
命令 passwd --help 的输出 -
passwd --help
Usage: passwd [options] [LOGIN]
Options:
-a, --all report password status on all accounts
-d, --delete delete the password for the named account
-e, --expire force expire the password for the named account
-h, --help display this help message and exit
-k, --keep-tokens change password only if expired
-i, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-l, --lock lock the named account
-n, --mindays MIN_DAYS set minimum number of days before password
change to MIN_DAYS
-q, --quiet quiet mode
-r, --repository REPOSITORY change password in REPOSITORY repository
-S, --status report password status on the named account
-u, --unlock unlock the named account
-w, --warndays WARN_DAYS set expiration warning days to WARN_DAYS
-x, --maxdays MAX_DAYS set maximim number of days before password
change to MAX_DAYS
我发布的速度有点快,看起来 passwd 和 chage 都可以满足您想要完成的任务:
sudo chage [username] 将允许您以交互方式进行设置。否则这里是 chage 和 passwd 的帮助输出。
chage --help 输出:chage --help 用法:chage [选项] [登录]
命令 passwd --help 的输出 -
您可以在/etc/login.defs中设置过期策略- 特别是 PASS_MAX_DAYS=、PASS_MIN_DAYS= 和 PASS_WARN_AGE=
您还需要编辑/etc/default/useradd - INACTIVE= 和 EXPIRE=
情况并不完全相同,但这里有更多信息:过期非活动用户帐户