目 录CONTENT

文章目录

华为openEuler安装fail2ban

vanegoo
2024-05-07 / 0 评论 / 0 点赞 / 4 阅读 / 1991 字 / 正在检测是否收录...

检查本机python

[root@vanegoo ~]# python -V
Python 3.9.9

下载 fail2ban

[root@vanegoo ~]# git clone https://github.com/fail2ban/fail2ban.git

安装

[root@vanegoo ~]# cd fail2ban
[root@vanegoo fail2ban]# python setup.py install

配置systemctl service

[root@vanegoo fail2ban]# cp build/fail2ban.service /lib/systemd/system/fail2ban.service

# 增加一行
[root@vanegoo fail2ban]# vim /lib/systemd/system/fail2ban.service
Environment="PYTHONPATH=/usr/local/lib/python3.9/site-packages"

配置规则

[root@vanegoo fail2ban]# cd /etc/fail2ban/
[root@vanegoo fail2ban]# cp jail.conf jail.local 
[root@vanegoo fail2ban]# vim jail.local

启动fail2ban

[root@vanegoo ~]# systemctl enable --now fail2ban

0

评论区