to set the password complexity under Linux:
(1) Modify/etc/login.defs file
pass_max_days #密码最长过期天数
Pass_min_days #密码最小过期天数
Pass_min_len #密码最小长度
Pass_warn_age 7 #密码过期警告天数
(2) Modify/etc/pam.d/system-auth file
find password requisite pam_cracklib.so such a line as the following:
Password requisite pam_cracklib.so retry=5 difok=3 minlen=10 ucredit=-1 lcredit=-3 dcredit=-3 dictpath=/usr/share/c Racklib/pw_dict
parameter meaning:
Number of attempts: 5 least different characters: 3 Minimum password length: 10 least Capital Letter: 1 Least lowercase letters: 3 minimum: 3 Password dictionary:/usr/share/cracklib/pw_dict
Note: You may be able to test immediately after modification:
useradd Test
passwd Test
feeling does not work, hehe. This is because you are now running as root. After exiting the root status, try using the test login to change the password.
does it work? It's supposed to work.