当前位置:网站首页>如何使用Fail2Ban保护WordPress登录页面
如何使用Fail2Ban保护WordPress登录页面
2022-07-28 16:04:00 【星哥玩云】
Fail2Ban扫描/var/log/auth.log之类的日志文件,并禁止IP地址进行过多的失败登录尝试。它通过更新系统防火墙规则以在可配置的时间内拒绝来自那些IP地址的新连接来实现此目的。 Fail2Ban开箱即用,可以读取许多标准日志文件,例如sshd和Apache的文件,并且可以轻松配置为读取您选择的任何日志文件,以解决所需的任何错误。
在这篇文章中,我向您介绍了如何使用Fail2Ban保护SSH服务。现在,我将指导您如何使用Fail2Ban保护WordPress登录页面。
要与WordPress集成,您需要在WordPress中安装WP fail2ban插件。
安装后,需要将WP fail2ban插件文件夹(通常位于wordpress/wp-content/plugins/wp-fail2ban)的文件夹中的wordpress.conf文件复制到Fail2ban文件夹(位于 /etc/fail2ban/filter.d)。然后在/etc/fail2ban/jail.conf件中编辑Fail2ban配置,在其中添加WordPress部分:
[wordpress] enabled = true filter = wordpress logpath = /var/log/auth.log port = http,https maxretry = 5 findtime = 3600 bantime = 86400
本节将所有访问错误都写入/var/log/auth.log文件,此过滤器适用于http和https。但是,如果在Web服务器的配置中使用了高速缓存代理,则还需要为WP fail2ban插件指定它,以便它开始从特殊标头中获取客户端地址,而不是Frontend-proxy的地址。为此,请打开wp-config.php文件,并在其中添加包含代理服务器配置的行。
define(‘WP_FAIL2BAN_PROXIES’,‘127.0.0.1’); 127.0.0.1 is the address of the proxy server.
现在,重新启动Fail2ban:
service fail2ban restart
边栏推荐
- "Wei Lai Cup" 2022 Niuke summer multi school training camp 3 j.journey 0-1 shortest path
- MD5 encryption verification
- parseJson
- LwIP development | socket | UDP
- Leetcode daily practice - the number of digits in the offer 56 array of the sword finger
- 阿里云 MSE 支持 Go 语言流量防护
- 记录开发问题
- egg(十九):使用egg-redis性能优化,缓存数据提升响应效率
- Fx3 development board and schematic diagram
- Reset grafana login password to default password
猜你喜欢

Re14:读论文 ILLSI Interpretable Low-Resource Legal Decision Making

HM secondary development - data names and its use

Using pyqt to design gui in ABAQUS

Ansa secondary development - build ansa secondary development environment on Visual Studio code

快速掌握 Kotlin 集合函数

HyperMesh auto save (enhanced) plug-in instructions

有趣的 Kotlin 0x07:Composition

Ruoyi's solution to error reporting after integrating flyway

LeetCode每日一练 —— 剑指Offer 56 数组中数字出现的次数

Call DLL file without source code
随机推荐
asmlinkage的理解
NoSQL introduction practice notes I
The local area network cannot access the Apache server
WSL+Valgrind+Clion
IM即时通讯开发优化提升连接成功率、速度等
Ruoyi集成flyway后启动报错的解决方法
小程序:获取元素节点信息
【深度学习】:《PyTorch入门到项目实战》:简洁代码实现线性神经网络(附代码)
快速掌握 Kotlin 集合函数
做题笔记3(二分查找)
Optimization of network request success rate in IM instant messaging software development
MD5 encryption verification
QT designer for QT learning
Oracle system composition
Ansa secondary development - apps and ansa plug-in management
局域网无法访问apache服务器
Leetcode daily practice - 160. Cross linked list
Splash (rendering JS service) introduction installation
Sort 5-count sort
College students participated in six Star Education PHP training and found jobs with salaries far higher than those of their peers