ubuntu 防放破解

https://blog.csdn.net/weixin_52270081/article/details/121496140
#!/bin/bash
#set -x
list=$(sudo lastb |awk '{print $3}'|sort |uniq -c|awk '{if ($1 > 4) print $2}')
for ip in ${list}
do
	echo ALL: ${ip} >> /etc/hosts.deny #加入黑名单
	echo > /var/log/btmp	#清空失败记录,防止脚本下次执行重复统计IP
done
* */1 * * * sudo bash /home/ubuntu/ssh_deny.sh
ALL: 85.31.44.212
发布日期:
分类:未分类

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注