佚名 通过本文向大家介绍了centos iptables命令,centos 7 iptables,centos 关闭iptables,centos6.5 iptables,centos iptables等相关知识,希望对您有所帮助,也希望大家多多支持微课江湖
查看当天登陆未成功的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
效果: