我在网上find的一切都提到注释cracklib …但它不存在于我的system-auth文件中。
我想禁用CentOS在用户更改密码时所做的字典检查。
这是我的系统validation文件:
#%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 sufficient pam_unix.so nullok try_first_pass auth requisite pam_succeed_if.so uid >= 1000 quiet_success auth required pam_deny.so account required pam_unix.so account sufficient pam_localuser.so account sufficient pam_succeed_if.so uid < 1000 quiet account required pam_permit.so password requisite pam_pwquality.so try_first_pass local_users_only retr$ password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_a$ password required pam_deny.so session optional pam_keyinit.so revoke session required pam_limits.so -session optional pam_systemd.so session [success=1 default=ignore] pam_succeed_if.so service in crond quiet$ session required pam_unix.so
有强烈的警告,你不应该试图禁用这个开始:
字典检查由cracklib通过pam_pwquality处理,您应该已经在/etc/pam.d/system-auth文件中看到该字典。
当前版本的pam_pwquality的手册页build议禁用字典检查的选项:
dictcheck=N If nonzero, check whether the password (with possible modifications) matches a word in a dictionary. Currently the dictionary check is performed using the cracklib library. The default is 1 which means that this check is enabled.
手册页还指出,您可以将其添加到/etc/security/pwquality.conf或作为/etc/pam.d/system-auth一个选项(可能会被系统工具覆盖,所以您应该避免在更改时您可以)。
不幸的是,Red Hat在EL 7中提供的dictcheck版本不支持dictcheck选项。 所以你唯一真正的解决scheme是根本不使用pam_pwquality。 请注意,对此进行注释也会禁用所有其他检查,例如最小密码长度和字符复杂度。