How To Set Password Policy On A CentOS
How To Set Password Policy On A CentOS
How To Set Password Policy On A CentOS
================================CentOS6============================================
Step 1: Configuring /etc/login.defs — Aging and Length
Password aging controls and password length are defined in /etc/login.defs file.
Password aging refers to the maximum number of days password may be used, minimum
number of days allowed between password changes,
and number of warning days before the password expires. Password length refers to
the number of characters needed to have for the password
to be allowed. To configure password aging controls and password length, edit
/etc/login.defs file and set PASS values according to your company
password policy.
The password aging controls and password length do not affect existing users, they
only affect newly created users!
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.
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth sufficient pam_unix.so nullok try_first_pass
auth requisite pam_succeed_if.so uid >= 500 quiet
auth required pam_deny.so
account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
password requisite pam_cracklib.so try_first_pass retry=3 type= dcredit=-2
ucredit=-2 lcredit=-2 ocredit=-2
password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
remember=5
password required pam_deny.so