linux下防止暴力破解:http://297020555.blog.51cto.com/1396304/574570
步骤:
1 备份相应的配置文件
[root@redhat pam.d]# cp system-auth system-auth.bak(备份文件)
2 将配置文件system-auth,修改后内容如下所示:
[root@redhat pam.d]# more 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 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
3 验证我们的配置
用普通用户登录,随便输入个密码或者不输都可以登陆。想要root权限的话,直接su root或以root的身份登陆 ,密码随便输或者不输都可以。