Linux 上的密码强度强制执行

jfo*_*her 2 linux password

如何在 Linux 上强制执行用户密码的最小长度和复杂性?

谢谢

dav*_*vey 6

您应该查看“pam”的所有内容,尤其是pam_passwdqc.so代表 Pluggable Authentication Modules 的模块。此处的手册页:http ://linux.die.net/man/8/pam_passwdqc此处的文章:https://web.archive .org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-6111316.html

这个小小的 perl one liner 将按照 NSA Securing Linux Guide 设置密码质量:

perl -p -i.prekickstart -e 'BEGIN {print stderr "Configure password quality module\n";}  \
                s{(^password\s+requisite\s+)(pam_cracklib.so)(.*)}{$1 pam_passwdqc.so min=disabled,disabled,16,12,8} ;' /etc/pam.d/system-auth
Run Code Online (Sandbox Code Playgroud)

(在 RedHat/Centos 上测试)。