Secure Your Wordpress Admin Folder With lighttpd

As you might have guessed, I’m ultra concerned about security. Security isn’t my area of expertise, nor do I claim to have any superior knowledge in the field, but sometimes being ahead of the game can prove beneficial. Shoemoney’s blog has been defaced twice (to my knowledge), simply because he failed to upgrade. This gives me a sense of safety since I not only religiously upgrade, but take additional counter measures as well. One of those counter measures is limiting access to special directories with lighttpd. Let’s get to work.

First, open up your /etc/lighttpd/lighttpd.conf file in your favorite text editor. Add this segment of code just before you start defining your virtual host settings:

$HTTP["remoteip"] !~ "10.10.10.220" {
   $HTTP["url"] =~ "^/wp-admin/" {
     url.access-deny = ( "" )
   }
}

You’ll obviously need to replace 10.10.10.220 with your IP address. This little trick will prevent access to /wp-admin/, and anything below that folder, unless of course they’re coming from your IP. I’m not familiar with a way to spoof the REMOTE_ADDR variable, but I’m sure a method exists through packet editing or something. That’s why there’s an authentiation system & strong passwords (you are using $7r0ng-p@$$w0rd$-r1gHt??!@). If someone is clever enough to spoof their IP address, they must first figure out the IP addresses that are permitted access, and then pass the login screen.

Alright, but lets say you want to write posts from school, or work. Maybe you have contributing authors that need access to the admin panel. No problem, we can add more IP addresses easily. Here’s how:

$HTTP["remoteip"] !~ "10.10.10.220|10.50.20.15|12.12.220.*" {
   $HTTP["url"] =~ "^/wp-admin/" {
     url.access-deny = ( "" )
   }
}

Simply insert a syntax or pipe symbol ( | ) , followed by the IP address you’d like to grant access to. Notice the last IP (12.12.220.*) has an asterisk. This obviously means anyone from the class C .220 can access the admin panel as well. 12.12.200.0-255. Not advised, but possible.

So now you know how to secure and limit access to folders with lighttpd. What are some of the ways you secure your web-sites?

Additional Posts Worth Reading

 

Comments »

No comments yet.

Name (required)


E-mail (required - never shown publicly)


URI - Web Site Address






Subscribe

Site of The Day

Sponsors

Categories

Recent Comments

  • Arthur: I can’t even be an Ebay affiliate. Tried various ways but still declined. Any help or suggestions?
  • chicago web design: I can’t imagine that these will last very long before Google banishes them all. But for now...
  • D.Ksyte: Anyone involved with cron job scheduling might find this resource useful. Cron Sandbox at HxPI is an...
  • FoNiX: “…decode md5″ is not possible, only bruteforce: generate hash and compare with original.
  • Z@$#: plz plz decript this hash for me any one….its really important…. 2CAD28C7C619F27DDE7B83C4999795BA
  • Joe: Thanks for writing this up. I tried the second method…however after the debian install the screen looks...
  • Scott: Was this issue ever resolved? I just started having a problem a couple weeks ago. I don’t do any kind of...
  • Prashant Patel: I had integrated Sp3 in Xp But finding one problem. In the Task Manager Process windows many services...
  • Ed: This looks like a real ‘leet’ linux command but it misses the point. Why would a hacker keep the name of...
  • Sudesh: My account was disabled but I followed their guideline and in one sec it was back on :) Here is the...

Top Commentators

Miscellaneous

  • Add to Technorati Favorites