CentOS下iptables封IP的命令讲解

 
CentOS下iptables封IP的命令讲解
2017-04-02 10:07:29 /故事大全

查看当天登陆未成功的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

效果:

所属专题:
如果您觉得本文或图片不错,请把它分享给您的朋友吧!

 
故事大全
 
版权所有- © 2012-2025 · 故事大全 SITEMAP站点地图-Foton Auman手机看故事 站点地图-Foton Auman