Something like this will enforce strong passwords and number of bad passwords until account lock
/etc/pam.d/system-auth (Redhat)
Something like this will set password expire, warning etc for new users addedCode:#%PAM-1.0 # This file is auto-generated. # User changes will be destroyed the next time authconfig is run. auth required /lib/security/$ISA/pam_env.so auth required /lib/security/$ISA/pam_tally.so onerr=fail no_magic_root auth sufficient /lib/security/$ISA/pam_pwdb.so likeauth nullok auth required /lib/security/$ISA/pam_deny.so account required /lib/security/$ISA/pam_pwdb.so account required /lib/security/$ISA/pam_tally.so deny=3 no_magic_root reset password required /lib/security/$ISA/pam_cracklib.so retry=3 minlen=8 lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1 type= password sufficient /lib/security/$ISA/pam_pwdb.so nullok use_authtok md5 shadow password required /lib/security/$ISA/pam_deny.so session required /lib/security/$ISA/pam_limits.so session required /lib/security/$ISA/pam_pwdb.so
/etc/login.defs (Redhat)
Some timeouts (same file)Code:# 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 90 PASS_MIN_DAYS 15 PASS_MIN_LEN 8 PASS_WARN_AGE 10
To change existing users, you'll have to script something that either does a usermod for all users above a certain UID OR script something that edits /etc/shadow to look like this for users above XXX UID.Code:LOGIN_RETRIES 5 FAIL_DELAY 4
Code:user:PASS-HASH:13243:15:90:10:14:-1:-1


Reply With Quote

Bookmarks