密码策略

vi /etc/login.defs

PASS_MAX_DAYS 60

PASS_MIN_DAYS 3

PASS_MIN_LEN 8

PASS_WARN_AGE 7

vi /etc/pam.d/system-auth

minlen=12 lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1 enforce_for_root

authconfig --passminlen=12 --update

authconfig --passmaxclassrepeat=4 --update

authconfig --enablereqlower --update

authconfig --enablerequpper --update

authconfig --enablereqdigit --update

authconfig --enablereqother --update

vi /etc/security/pwquality.conf

maxsequence = 4

difok = 6

authconfig --test | grep hashing

authconfig --passalgo=sha512 --update

authconfig --test | grep hashing

vi /etc/pam.d/sshd

auth required pam_tally2.so onerr=fail deny=3 unlock_time=300 even_deny_root root_unlock_time=300