#!/bin/bash #此脚本为自动封ssh登录次数 num=10 #输错密码上限 for i in `awk '/Failed/{print (NF-3)}' /var/log/secure|sort|uniq -c|sort -rn|awk '{if (1>num){print2}}'` do iptables -I INPUT -p tcp -s $i --dport 22 -j DROP done
centos6 通过Iptablse 自动BAN 猥亵ssh的IP
Bookmark the permalink.