Configure a CentOS5.5 password policy instance

Source: Internet
Author: User
1. modify the red part of the/etc/login. defs file # the maximum number of days that the PASS_MAX_DAYS password may be used. & Nbsp; # The password cannot be changed between the minimum number of days in PASS_MIN_DAYS. # PASS_MIN_LEN minimum password length. # Number of days before the PASS_WARN_AGE password expires. # PASS_MAX_DAYS999

1. modify the red part of the/etc/login. defs file.
# PASS_MAX_DAYS the maximum number of days that a password may be used.

 

# The password cannot be changed between the minimum number of days in PASS_MIN_DAYS.
# PASS_MIN_LEN minimum password length.
# Number of days before the PASS_WARN_AGE password expires.
#
PASS_MAX_DAYS 99999
PASS_MIN_DAYS 0
PASS_MIN_LEN 5

PASS_WARN_AGE 7

#

2. modify the/etc/pam. d/system-auth file as follows. pay attention to the red part [6688 e-commerce website www.6688.cc]

# % 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 required pam_tally.so onerr = fail deny = 3 unlock_time = 1800.
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_succeed_if.so uid <500 quiet
Account required pam_permit.so
Account required pam_tally.so

 

Password requisite pam_cracklib.so retry = 3 minlen = 8 lcredit =-1 ucredit =-1 dcredit =-1 ocredit =-1 difok = 3
Password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok remember = 3


Password required pam_deny.so

Session optional pam_keyinit.so revoke
Session required pam_limits.so
Session [success = 1 default = ignore] pam_succeed_if.so service in crond quiet use_uid
Session required pam_unix.so

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.