rhel5.3修改pam,三次密码错误锁定账户

[root@trs ~]# cat /etc/pam.d/system-auth
#%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
auth        required      /lib/security/pam_tally.so onerr=fail no_magic_root

account     required      pam_unix.so
account     sufficient    pam_succeed_if.so uid < 500 quiet
account     required      pam_permit.so
account     required      /lib/security/pam_tally.so deny=5 no_magic_root reset

password    requisite     pam_cracklib.so try_first_pass retry=3
password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok
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

只需要增加

auth        required      /lib/security/pam_tally.so onerr=fail no_magic_root

account     required      /lib/security/pam_tally.so deny=5 no_magic_root reset

日志显示

Mar 11 17:29:14 trs sshd[3930]: pam_unix(sshd:session): session opened for user root by (uid=0)
Mar 11 17:31:36 trs sshd[3974]: PAM unable to dlopen(/lib/security/pam_tally.so)
Mar 11 17:31:36 trs sshd[3974]: PAM [error: /lib/security/pam_tally.so: wrong ELF class: ELFCLASS32]
Mar 11 17:31:36 trs sshd[3974]: PAM adding faulty module: /lib/security/pam_tally.so
Mar 11 17:31:41 trs sshd[3974]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=172.16.1.100  user=tt
Mar 11 17:31:43 trs sshd[3974]: Failed password for tt from 172.16.1.100 port 1728 ssh2

你可能感兴趣的:(职场,密码,pam,休闲,账户)