您的位置:首頁技術文章
文章詳情頁

CentOS下iptables封IP的命令講解

瀏覽:42日期:2022-06-06 17:57:34

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

效果:

相關文章:
国产综合久久一区二区三区