在新装的系统中,更改用户的密码时可能会遇到以下报错:
BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word
这是由于系统会对新密码进行检查,如果系统觉得新密码过于简单或不安全,系统就会报错。如果想继续使用简单的密码,可以通过更改/etc/pam.d/sysystem-auth文件的以下两行内容来归避以上的报错信息。
#备份文件
cp /etc/pam.d/system-auth /etc/pam.d/system-auth.`date +%Y%m%d.%H%M%S`
vim /etc/pam.d/system-auth
#注释掉以下行
#password requisite pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=
#删除掉下行中的选项use_authok
password sufficient pam_unix.so sha512 shadow nullok try_first_pass #use_authtok
完成文件的以上两个地方的更改后,报错就不会再出现。