查看当天登陆未成功的IP

一条命令把这些IP全部封掉:

for i in `grep "$(date +"%b %d")" /var/log/secure | grep "Failed password" | awk '{print $(NF-3)}' | sort | uniq -c | sort -nr| awk '{print $2}'` ;do iptables -A INPUT -s $i -j DROP; done

效果:

点赞(90)

评论列表共有 0 条评论

立即
投稿
返回
顶部