WordPress-10步增加WP的后台安全性
翻译自"10 Steps To Protect The Admin Area In WordPress",有兴趣的可以直接点击查看原文,以下内容较原文有很多删减。
Needs to protect: the administration area in WordPress
Protect the administration area of your WordPress blog.
To make an attack more difficult, you should perform the following actions manually. These solutions do not guarantee 100% security, but you can create effective stumbling blocks on a hacker’s way to the administration area.
1. Rename and Upload the wordpress Folder
重命名WordPress所在目录名
在v2.6之后,我们可以在后台修改WordPress文件所在目录,不过可惜的是,我们无法单独修改wp-admin文件夹的名称。
不过有总比没有好啦。
2. Extend the file wp-config.php
扩展设置你的wp-config.php
在v2.7开始,我们可以设置以下几个安全参数:
define('AUTH_KEY', '替换该字符串');
define('SECURE_AUTH_KEY', '替换该字符串');
define('LOGGED_IN_KEY', '替换该字符串');
define('NONCE_KEY', '替换该字符串');
另外,还有$table_prefix参数,或者,你可以在里边加入
define(’FORCE_SSL_ADMIN’, true);
来增加登录的安全校验。
你也可以学习其他系统的安全设置,关于改文件的设置可以参考WordPress Codex
3. Move the wp-config.php file
移动wp-config.php文件
在v2.6之后,我们可以将wp-config.php文件移动到安装文件包外边……
个人猜测这个应在是WordPress安装在子文件夹内的时候才会发生的状况。
具体没有测试过,这段的原文如下:
Also since version 2.6, WordPress allows you to move the wp-config.php file to a higher level. Because this system file contains by far more sensitive information than any other, and because it is difficult to access the parent file server level, it certainly makes sense to store it outside of the actual installation. WordPress automatically looks at the highest underlying index for the configuration settings file. Any attempt by users to adjust the path is thus useless.
4. Protect the wp-config.php file
保护wp-config.php文件
这个需要主机支持,在.htaccess文件里增加下边的代码:
# protect wp-config.php <files wp-config.php> Order deny,allow deny from all </files>
5. Delete the admin User Account
删除admin帐号
由于admin是内建帐号,这相当于告诉了别人帐号名,所以存在安全隐患,最简单的做法就是用admin帐号登录后,建立一个新帐号,然后提升为admin权限,接着用新帐号登录,删除掉admin帐号即可。
6. Choose strong passwords
使用强壮的密码,哈,不知道是不是该翻译成"强壮"?
这个就不多说了,尽量长,尽量复杂的组合,应该就可以了。
7. Protect the wp-admin Directory
保护wp-admin目录
这个需要在wp-admin目录里设置.htpasswd文件,具体的设置请参考:http://www.htaccesstools.com/htpasswd-generator,唉,杭州这里无法访问改url,估计被电信和谐了……
8. Suppress Error Feedback on the Log-In Page
禁止Login页的登录错误信息
这一点我觉得有点多余了吧,去除掉登录时候显示的登录错误信息……
add_filter('login_errors',create_function('$a', 'return null;'));
9. Restrict Erroneous Log-In Attempts
限制登录尝试次数
这个挺有必要的,有2个解决方案:
1.Login LockDown
2.Limit Login Attempts
这2个插件都可以限制登录次数。
10. Keep Software Up to Date
保持WordPress的版本更新
最好是保持到最新的正式版本,个人建议哈……另外插件也要记得更新到最新版本。
最后加一条,有些皮肤模板里边有人加了恶意代码…SO,请从正规网站下载皮肤...
February 25th, 2009 - 12:40
Hmm, very cognitive post.
Is this theme good unough for the Digg?
[Reply]
December 14th, 2009 - 12:05
[Reply]