可是经本人测试实不可用,在尝试3次后会提示锁定,可是用正确密码仍可登录。无奈只得自行研究,并对此文件进行了解,结合网上一些教程,经过实验得出如下配置,在此随便鄙视下那些只会转载,不会实践的2B,浪费网络资源。
实用配置如下:
1 备份相应的配置文件
[root@redhat pam.d]# cp system-auth system-auth.bak(备份文件)
2 将配置文件system-auth,修改后内容如下所示:
[root@redhat pam.d]# vi 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 required pam_unix.so nullok try_first_pass (将原来的sufficient 改为required)
#auth requisite pam_succeed_if.so uid >= 500 quiet (注释掉此行)
#auth required pam_deny.so (注释掉此行)
auth required pam_tally2.so deny=5 onerr=fail (增加的一行)
account required pam_unix.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
account required pam_tally2.so (增加的一行)
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
如需管理员立刻解锁,可用如下命令pam_tally2.so -u 用户名 -r 进行清除
转载于:https://blog.51cto.com/ko178/1150898