1、登录Linux服务器。

2、编辑配置文件/etc/pam.d/system-auth。
#vi /etc/pam.d/system-auth

3、添加一条规则:
password requisite pam_cracklib.so retry=5 difok=3 minlen=10 ucredit=-1 lcredit=-3 dcredit=-3 dictpath=/usr/share/cracklib/pw_dict

4、测试:root用户不受此配置限制,普通用户需要安装配置要求修改密码。

5、参数说明:
retry:尝试次数
difok:最少不同字符
minlen:最小密码长度
ucredit:最少大写字母
lcredit:最少小写字母
dcredit:最少数字
dictpath:密码字典
