10秒内失败登录了3次 屏蔽ip登录

#!/bin/bash


while true

do

badip=$(lastb -i -a | awk '/ssh:notty/ {print $NF}'|sort|uniq -c|awk '($1>3) {print $2}')


for i in $badip

do

iptables -t filter -I INPUT -s $i -p tcp --dport 22 -j DROP

done


: > /var/log/btmp

sleep 10s

done


你可能感兴趣的:(filter,sleep)