sed -ir ‘/^PASS_MIN_LEN/s/5/8/’ /etc/login.defs
二。)在 /etc/pam.d/system-auth 文件中配置密码复杂度:
在 pam_cracklib.so 后面配置参数
sed ‘/password required pam_deny.so/i\password requisite pam_cracklib.so
minlen=8 ucredit=-2 lcredit=-1 dcredit=-4 ocredit=-1’ /etc/pam.d/system-
auth
password requisite pam_cracklib.so minlen=8 ucredit=-2 lcredit=-1 dcredit=-4
ocredit=-1
=1111==
password requisite pam_cracklib.so retry=5 difok=3 minlen=10 ucredit=-1
lcredit=-3 dcredit=-3 dictpath=/usr/share/cracklib/pw_dict
参数含义:
尝试次数:5 ;最少不同字符:3 ;最小密码长度:10 ;最少大写字母:1;
最少小写字母:3 ;最少数字:3 ;字典位置:/usr/share/cracklib/pw_dict
=1111==
sed -i.bak ‘/password required pam_deny.so/i\password requisite
pam_cracklib.so minlen=8 ucredit=-2 lcredit=-1 dcredit=-4 ocredit=-1’
/etc/pam.d/system-auth
评论10
最新资源