Password complexity:
1. First install apt install libpam-cracklib -y
2. vim /etc/pam.d/common-password
3. Add password requisite pam_cracklib.so retry = 3 minlen = 10 difok = 3 ucredit = -1 at the end of step 2 lcredit = -2 dcredit = -1 ocredit = -1
Restart the system, test the account login, modify the password that does not meet the password complexity, and the modification fails. The strategy takes effect.
verification:
Modification period:
Reference: https://forum.ubuntu.org.cn/viewtopic.php?f=187&p=3218783#top
https://blog.csdn.net/lemontree1945/article/details/79264219