7

Besides having secure passwords for my blog user and database connections, what should I do to make sure my WordPress installation is secure on my Linux shared server?

7 Answers 7

6

I think the best suggestions are well explained in the official "Hardening Wordpress" document:

https://wordpress.org/support/article/hardening-wordpress/

At the end, those are the same suggestions for every application out there:

  • Keep it updated.
  • Use good passwords
  • Reduce what information your are presenting (versions, server info, etc).

If you want to improve security with obscurity (not only thought it, but as an addtional measure), this document gives some ideas:

http://sucuri.net/?page=docs&title=wordpress-hardening

8

Ensure you haven't set the file permissions to 'chmod 777' as some guides will have you do. Go through and look at anything your web server account or group can write to, and ensure that they are only areas you expect to be dynamically updated (images, attachments, etc).

1
  • +1 All that and make sure the web server itself is as secure as you can make it. Jul 20, 2009 at 22:08
5

Only login over an SSL connection.

If you go into a coffee shop and login at http://www.yourblog.com/wp-admin/ your password is sent in clear text and is easily visible to anyone sniffing the network in the coffee shop and all routers between you and the server.

If you move your blog login page to a secure server and force users to login using SSL at https://www.yourblog.com/wp-admin/ the password will be encrypted as it is sent to the server.

You can either add some PHP code to wordpress something like this

if(strpos(strtolower($_SERVER['REQUEST_URL']),'wp-admin')===true 
      && $_SERVER['HTTPS']!='ON')
{
    Header("Location: https://www.yourblog.com/wp-admin/")
}

or use a .htaccess file to enforce SSL login which would look something like this:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
3
4

Some people rename pages like wp-admin.php to reduce probing.

4

Secure your /wp-admin/ directory. Lock down /wp-admin/ so that only certain IP addresses can access that directory. You can use an .htaccess file, which you can place directly at /wp-admin/.htaccess . This is what one could look like:

AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName “Access Control”
AuthType Basic
order deny,allow
deny from all
# whitelist home IP address
allow from 69.148.58.93
# whitelist work IP address
allow from 69.148.59.6
allow from 69.148.58.92
# IP while in Kentucky; delete when back
allow from 63.144.53.91

Josh

2
  • Very good idea unless I am going to be traveling. Thank you for your good idea.
    – Mike Grace
    Jul 26, 2009 at 14:18
  • An equally good idea would be to just secure the same dir with an htpassword. Oct 5, 2011 at 17:09
3

Make sure that your WordPress installation is up to date. Keep up on the RSS and check up on the updates no less than weekly.

If there's an update, begin the installation process at the earliest possible time for you, obviously without disrupting business, if that's what you are using WP for.

0
2

Use a unique username/password for your database connection.

2
  • there's no problem there since I use 1password to generate my passwords like "xZcHkTfDTu2N4EwDFJom26Pm9G8KLmyXx9Bf7YLA3GD7FzztPd" ; )
    – Mike Grace
    Jul 20, 2009 at 22:27
  • Thats better then 99% of the folks out there. I've seen root so many times it makes me sick Jul 20, 2009 at 23:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .