Linux about password complexity settings __linux

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.