编辑配置文件:html
vi /etc/pam.d/sshd
在文末添加内容:ssh
auth required pam_tally2.so deny=5 unlock_time=600
表明失败5次,禁止访问600秒ui
保存退出spa
重启sshd服务rest
systemctl restart sshd
参考:传送门code