/etc/pam.d/common-password
# here are the per-package modules (the "Primary" block)
password requisite pam_pwquality.so retry=3 minlen=10 ucredit=-1 dcredit=-1 maxrepeat=3 reject_username difok=7 enforce_for_root
password [success=1 default=ignore] pam_unix.so obscure use_authtok try_first_pass yescrypt
# here's the fallback if no module succeeds
password requisite pam_deny.so
# prime the stack with a positive return value if there isn't one already;
/etc/login.defs
#
PASS_MAX_DAYS 30
PASS_MIN_DAYS 2
PASS_WARN_AGE 7
#
我对这个主题很陌生,如果您解释一下基本原因,我将不胜感激。
答案1
使用chage
带参数的命令-m
更改最小天数,-M
更改最大天数和适当的用户名。
例如:
chage -m 7 -M 30 root
更改 root 的密码设置