Prenumerera till Hur-Till Geek

Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

Skydd av din WordPress Admin panel från Hackers med .htaccess

Om du använder WordPress som plattformen bak din blog, eller websiten som du vet antagligen, att det har finnas en raddasäkerhet, spela golfboll i hål, inte rättvist i programvaran sig själv, men också i pluginsna som väl. I ljust av dessa problem ska vi look på hur man förhindrar dataintrångförsök, genom att låsa, besegrar din administrationsmapp.

Den Apache webbservern har en inbyggd mekanism som låter dig tilldela ett krävt lösenord för en mapp, som är separat från ditt WordPress lösenord.

Snabba Blog säkerhetsspetsar

Säkerhet är viktig nog att jag klädde med filt den som var nödvändig att inkludera några extra spetsar här. Detta är vid inget hjälpmedel som ett färdigt listar, men du bör se in i dem på något sätt.

  • Se till att du är rinnande den senaste versionen av WordPress och alla dina plugins.
  • Du bör betrakta att prenumerera till BlogSecurity.net, en den blog försök att täcka säkerhetsnyheterna om blogging plattformar.
  • Se till att ditt spara tillåtelser är fastställdt korrekt enligt WordPress anvisningar.
  • Se till att du använder tuffa lösenord för alla konton.
  • Se till att du är uppbackningen din hela WordPress installation och databas.
  • Låsa besegrar din administration som mappen med .htaccess härskar (täckt här)

Tilldela ett lösenord till arkivet wp-admin manuellt

Skapa en spara som namnges .htaccess i ditt arkiv wp-admin och tillfoga tillfredsställer efter:

AuthName ”skyddsområde”,
Grundläggande AuthType
AuthUserFile /var/full/web/path/.htpasswd
AuthGroupFile /dev/null
kräv giltig-användaren

Du ska behov att justera AuthUserFilen fodrar för att använda den fulla banan till .htpasswden sparar oss ska skapar i det nästa kliver. Du kan finna den fulla banan, genom att använda pwd befalla från beskjutabetalningspåminnelsen.

Därefter ska du behov att använda htpasswden befaller fodrar nytto- för att skapa lösenordet sparar. Jag skulle råder också, att du använder ett olikt användarekonto och lösenord, än dig använder för din WordPress installation.

$ htpasswd - myusername för c .htpasswd
Nytt lösenord:
Skriv om det nya lösenordet:
Tillfoga lösenordet för användaremyusername

You’ll want to make sure you are in the directory specified by AuthUserFile, and change “myusername” to something unique for your site. This will create a file with contents similar to the following:

myusername:aJztXHCknKJ3.

At this point you should be prompted for a password when you navigate to your WordPress administration panel. You’ll notice that “Restricted Area” is the text from the .htaccess file, which could be changed to anything else.

image

If you get a server error instead, you should probably remove the .htaccess file and start over.

Lastly, you should make sure that you remove write permissions to both files with the chmod command as one more layer of security.

chmod 444 .htaccess

chmod 444 .htpasswd

.htaccess Password File Generator

There’s a great tool from Dynamicdrive that will do all the hard work of creating the file for you. This is especially useful if you don’t have shell access to your server, because you can just upload the files via your FTP/SFTP client.

http://tools.dynamicdrive.com/password/

You should still make sure that you remove write access once the files are uploaded.

| More
This article was originally written on 12/5/07 Tagged with: Geek Stuff

Daily Email Updates

You can get our how-to articles in your inbox each day for free. Just enter your name and email below:


Name:
Email:

Comments (8)

  1. John

    This is great advice. It should be pointed out, however, that not everyone has access to create a .htaccess file with password. Many hosting services don’t give their users this kind of access.

  2. JasonS

    This may be a stupid question, I don’t know. I recently signed up for a new Wordpress account. The blog is hosted on their server. I didn’t download anything or install it on my web server. So, is any of this necessary?

  3. John

    Do you mean Wordpress.com? If so then you won’t be able to do this.

  4. Jake

    @JasonS: This refers to Wordpress.org, which is the actual CMS software. You are thinking of Wordpress.com, which is a free hosting service built around the Wordpress.org CMS. So no. Most free blog hosts will not allow you to mess with .htaccess.

  5. john parsons

    Trying to set up a password protection with .htaccess, can find no clear instructions of correct path in AuthUserFile. Is the following style of path correct

    /c:/Program Files/Apache…..etc

    every tutorial gives examples such as
    /var/full/web/path/.htpasswd
    or
    /home/file/….

    which make no sense to me.

    Thanks

  6. john.s

    Examples like /var/path/.htpasswd are for Unix-like systems (Linux).

    This only works on Linux and Unix-like systems, it DOES NOT work on Windows.

  7. khokon

    is it possible in joomla?

  8. abhi

    Thanks for the good info, it wil protect WP


Our Friends
Getting Started


About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
conhost.exe
Dpupdchk.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. All Rights Reserved.