当前位置:网站首页>如何使用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
边栏推荐
- Optimization of network request success rate in IM instant messaging software development
- 局域网无法访问apache服务器
- 有趣的 Kotlin 0x07:Composition
- [learn slam from scratch] publish the coordinate system transformation relationship to topic TF
- Wake up after being repeatedly upset by MQ! Hate code out this MQ manual to help the journey of autumn recruitment
- Signal and slot mechanism of QT learning
- 小程序:获取元素节点信息
- Ruoyi's solution to error reporting after integrating flyway
- Given positive integers n and m, both between 1 and 10 ^ 9, n < = m, find out how many numbers have even digits between them (including N and m)
- Multiple commands produce '... /xxx.app/assets.car' problem
猜你喜欢

ABAQUS GUI interface solves the problem of Chinese garbled code (plug-in Chinese garbled code is also applicable)

Introduction and implementation of queue (detailed explanation)

egg(十九):使用egg-redis性能优化,缓存数据提升响应效率

Leetcode daily practice - 160. Cross linked list

Leetcode learn to insert and sort unordered linked lists (detailed explanation)

Wake up after being repeatedly upset by MQ! Hate code out this MQ manual to help the journey of autumn recruitment

结构化设计的概要与原理--模块化

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

ANSYS secondary development - MFC interface calls ADPL file

Ansa secondary development - apps and ansa plug-in management
随机推荐
Call DLL file without source code
Ruoyi's solution to error reporting after integrating flyway
Is smart park the trend of future development?
Egg (19): use egg redis performance optimization to cache data and improve response efficiency
Wake up after being repeatedly upset by MQ! Hate code out this MQ manual to help the journey of autumn recruitment
小程序:scroll-view默认滑倒最下面
【深度学习】:《PyTorch入门到项目实战》第九天:Dropout实现(含源码)
关于 CMS 垃圾回收器,你真的懂了吗?
Understanding of asmlinkage
Oracle system composition
Several methods of HyperMesh running script files
大学生参加六星教育PHP培训,找到了薪水远超同龄人的工作
Epoll horizontal departure, which edge triggers
Asp.net large file block upload breakpoint resume demo
【深度学习】:《PyTorch入门到项目实战》第八天:权重衰退(含源码)
Some suggestions on optimizing HyperMesh script performance
Im im development optimization improves connection success rate, speed, etc
【深度学习】:《PyTorch入门到项目实战》第五天:从0到1实现Softmax回归(含源码)
Leetcode learn complex questions with random pointer linked lists (detailed explanation)
Do you really understand CMS garbage collector?