建议修改/etc/pam.d/system-auth下相关设置,增加条目:
auth required pam_tally2.so deny=5 unlock_time=900 even_deny_root_account audit
ubuntu本地登录设置/etc/pam.d/login
auth required pam_tally2.so deny=3 unlock_time=60 even_deny_root root_unlock_time=60
ubuntu登录限制/etc/pam.d/common-auth
auth required pam_tally2.so deny=3 unlock_time=60 even_deny_root root_unlock_time=60
重启生效
/etc/init.d/ssh restart
查看输入错误次数
pam_tally2 --user[=test]
没有帐号? 立即注册