简介
Fail2Ban是一个入侵检测系统框架,它可以保护电脑服务器免受蛮力攻击。以Python程序设计语言编写,并能够在POSIX系统上运行。
配置流程
1.配置编译环境
1)安装wget包
yum install wget-y
2)安装依赖
fail2ban编译安装要求Python2>=2.6或者Python3>=3.2。
Python2安装请参考https://www.huaweicloud.com/kunpeng/software/python.html,
Python3安装请参考https://www.huaweicloud.com/kunpeng/software/python3.html。
2.获取源码
获取“fail2ban-0.9.4”源码包。
cd/usr/local/src wget https://github.com/fail2ban/fail2ban/archive/0.9.4.tar.gz-O fail2ban-0.9.4.tar.gz
3.编译和安装
1)解压软件包。
tar-zxvf fail2ban-0.9.4.tar.gz
2)进入fail2ban的安装目录。
cd fail2ban-0.9.4
3)编译和安装fail2ban。
python setup.py install
4.运行和验证
执行如下命令,查看fail2ban相关版本。
fail2ban-server--version
回显信息如下,则表示fail2ban安装成功。fail2ban-client,fail2ban-regex,fail2ban-testcases命令类似。
Fail2Ban v0.9.4 Copyright(c)2004-2008 Cyril Jaquier,2008-Fail2Ban Contributors Copyright of modifications held by their respective authors. Licensed under the GNU General Public License v2(GPL). Written by Cyril Jaquier<cyril.jaquier fail2ban.org>. Many contributions by Yaroslav O.Halchenkodebian onerussian.com>.