WordPress 是目前最流传的 CMS,正由于如许,针对它的登录爆破就时刻从未终止过。

正因如许,仍是未雨绸缪做一些防护比较好。本次绍介在使用 Apache 的 云主机 上,如何限制 IP 访问 WordPress 后台登录。

写入 Apache 的配置文件 httpd.conf 或者站点根目录下的 .htaccess 都可以。

<Files wp-login.php>
Order deny,allow
Deny from all
Allow from xx.xx.xx.0/24
#Another IP
Allow from xx.xx.xx.xx
</Files>

替换 xx.xx.xx.xx  成你的IP地址。 要知道你的IP地址你可以在百度中输入IP即可查询,也可以访问 MyIP

 

PS:Nginx 配置如下。

location /wp-login.php {
deny all;
allow xx.xx.xx.0/24;
allow xx.xx.xx.xx;
}

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注