#!/bin/bash service iptables status |awk '{print $5}' |grep -v s|grep -v 224.0.0.1 |grep -v 218.79.203.91|grep -v ^0 |grep -v 127|grep -v ^$ |grep -v 10.1 >/root/test.txt sed -i '1,$s/^/all:/g' /root/test.txt sort /etc/hosts.deny |uniq >> /root/test.txt cat /root/test.txt > /etc/hosts.deny service fail2ban restart
捕获fail2ban截获的Ip写入拒绝主机列表
原创
©著作权归作者所有:来自51CTO博客作者tkggvfhpce的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
使用nmcli修改双网卡主机ip地址,划分vlan
nmcli 是一个用于控制NetworkManager的命令行工具,可以用于在 Linux 系统中管理网络连接。
linux双网卡 Centos stream 9 rocky 9 vlan nmcli -
SpringBoot集成Ip2region实现IP白名单
SpringBoot集成Ip2region实现IP白名单 区域判断
IP 白名单 SpringBoot ip2region -
实战 fail2ban 安装
实战 fail2ban 安装
fail ban -
Fail2Ban之python
http://lilinji.blog.51cto.com/5441000/1784726
Fail2Ban之python -
odoo 结合fail2ban
在配置fail2ban的时候遇到很多坑,现在记录下 先参考一篇博客的教程: https://atjason
odoo 服务器 nginx 数据库 -
fail2ban安装与使用
fail2ban安装与使用
fail2ban 安装 使用