我现在使用的是 Red Hat 6.6,尝试强制执行 root 用户的密码策略。我的 /etc/pam.d/system-auth 文件包含以下几行:
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth sufficient pam_fprintd.so
auth required pam_tally2.so deny=5 unlock_time=900
auth sufficient pam_unix.so nullok try_first_pass
auth requisite pam_succeed_if.so uid >= 500 quiet
auth required pam_deny.so
account required pam_tally2.so
account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
password requisite pam_cracklib.so try_first_pass retry=3 type= ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1 maxrepeat=3 \
reject_username enforce_for_root
password sufficient /lib64/security/pam_unix.so sha512 shadow nullok remember=5 use_authtok
password required pam_deny.so
session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so
它适用于 passwd 命令,当我尝试将密码更改为简单密码(如“123”)时,它不接受密码。
但是当我尝试通过 GUI(gnome2、system-config-users 实用程序)进行更改时,它只会发出有关密码复杂性不佳的警告,而且我仍然可以应用弱密码。
我如何拒绝通过 GUI 设置弱密码?
答案1
我已经下载了 system-config-users 的源代码,但似乎没有这种可能性(即使 pam 失败,它总是建议继续)