shell脚本精华----在10秒内SSH登录失败次数超过3次就使用iptables/tcpwrappers拒绝
#!/bin/bashwhiletruedobadip=$(lastb-i-a|awk'/ssh:notty/{print$NF}'|sort|uniq-c|awk'($1>3){print$2}')foriin$badipdoiptables-tfilter-IINPUT-s$i-ptcp--dport22-jDROPdone:>/var/log/btmpsleep10sdone本文出自“运维!