CentOS Server Password Rule customization

Source: Internet
Author: User

With the widespread use of Linux, the security requirements for Linux users and systems are increasing, and user password complexity is the primary embodiment of system security.
So how to restrict the password of the user under Linux to ensure that the user must use the complex password, prevent the user to use the simple password freely, thus improve the user's security and the system security.


To modify the default password rules for the server, you need to modify the/etc/pam.d/system-auth file
As follows:
Modify the/etc/pam.d/system-auth file to change the file

Password requisite pam_cracklib.so try_first_pass retry=3

Password sufficient pam_unix.so MD5 shadow Nullok try_first_pass Use_authtok

Modified to:

Password requisite pam_cracklib.so try_first_pass retry=3 minlen=8 ucredit=-2 lcredit=-4 dcredit=-1 ocredit=-1< /c1>

Password sufficient pam_unix.so MD5 shadow Nullok try_first_pass use_authtok remember=5


The above modification parameters indicate the following rules to follow when setting the password:

Minlen=8 Minimum password length is 8 bits
Ucredit=-2 with at least 2 uppercase letters
lcredit=-4 minimum of 4 lowercase characters
Dcredit=-1 minimum of 1 digits
Ocredit=-1 Minimum of 1 symbols
remember=5 password last 5 times cannot be reused

This way, the password is set according to the custom rules, and there will be some improvements in secure login!

CentOS Server Password Rule customization

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.