How To Set Password Policy on CentOS/RHEL 5/6/7

Password policy is a critical factor in PC security since user passwords are too often the main purpose behind computer system security break. The secret word approach expected to characterize the minimum length of a password, the number of days a password is valid, the strength of a passowrd, and a notice period to alert people that their password is going to expire.

Password Policy

Configure Password Policy – Aging and Length

The maximum number of days allowed, minimum number of days allowed, and number of warning days before the password expires refers to password aging, same as the number of characters needed to have for the password to be allowed refers to password length. This setting impact only when creating a user, not impact to exisiting users.

# vim /etc/login.defs
# Password aging controls:
#
#       PASS_MAX_DAYS   Maximum number of days a password may be used.
#       PASS_MIN_DAYS   Minimum number of days allowed between password changes.
#       PASS_MIN_LEN    Minimum acceptable password length.
#       PASS_WARN_AGE   Number of days warning given before a password expires.
#
PASS_MAX_DAYS   30
PASS_MIN_DAYS   7
PASS_MIN_LEN    9
PASS_WARN_AGE   5

Enjoy it!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.