当前位置:网站首页>如何使用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
边栏推荐
- Learn to use MySQL explain to execute the plan, and SQL performance tuning is no longer difficult
- Ruoyi's solution to error reporting after integrating flyway
- Leetcode daily practice - 160. Cross linked list
- 【从零开始学习SLAM】将坐标系变换关系发布到 topic tf
- First day of QT study
- Signal shielding and processing
- 概率论与数理统计第一章
- 阿里云-武林头条-建站小能手争霸赛
- Outline and principle of structured design -- modularization
- Redis source code optimization -- binding core
猜你喜欢

Do you really understand CMS garbage collector?

【指针内功修炼】字符指针 + 指针数组 + 数组指针 + 指针参数(一)

Leetcode learn complex questions with random pointer linked lists (detailed explanation)

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

【深度学习】:《PyTorch入门到项目实战》第八天:权重衰退(含源码)

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

FX3开发板 及 原理图

Interesting kotlin 0x09:extensions are resolved statically

Interesting kotlin 0x06:list minus list

大学生参加六星教育PHP培训,找到了薪水远超同龄人的工作
随机推荐
ticdc同步数据怎么设置只同步指定的库?
HM secondary development - data names and its use
【从零开始学习SLAM】将坐标系变换关系发布到 topic tf
【深度学习】:《PyTorch入门到项目实战》:简洁代码实现线性神经网络(附代码)
Analysis of echo service model in the first six chapters of unp
Design direction of daily development plan
Ansa secondary development - apps and ansa plug-in management
日常开发方案设计指北
College students participated in six Star Education PHP training and found jobs with salaries far higher than those of their peers
MySQL CDC if the binlog log file is incomplete, can you read all the data in the full volume stage
有趣的 Kotlin 0x07:Composition
leetcode647. 回文子串
做题笔记4(第一个错误的版本,搜索插入位置)
First day of QT study
重置grafana登录密码为默认密码
Re13:读论文 Gender and Racial Stereotype Detection in Legal Opinion Word Embeddings
Configure HyperMesh secondary development environment on vs Code
Each account corresponds to all passwords, and then each password corresponds to all accounts. How to write the brute force cracking code
Interesting kotlin 0x08:what am I
阿里云 MSE 支持 Go 语言流量防护