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.

Protecting Your WordPress Admin Panel From Hackers With .htaccess Bảo vệ WordPress Admin Panel của bạn Từ hacker Với. Htaccess

If you are using WordPress as the platform behind your blog or website you probably know that there have been a lot of security holes, not just in the software itself, but also in the plugins as well. Nếu bạn đang sử dụng WordPress như là nền tảng đằng sau blog của bạn hoặc trang web của bạn có thể biết rằng đã có rất nhiều lỗ hổng bảo mật, không chỉ trong các phần mềm riêng của mình, nhưng cũng có trong phần bổ là tốt. In light of these problems, we'll look at how to prevent hacking attempts by locking down your administration folder. Trong ánh sáng của những vấn đề này, chúng tôi sẽ xem xét làm thế nào để ngăn chặn nỗ lực hack bằng cách khóa xuống thư mục quản trị của bạn.

The Apache web server has a built-in mechanism that allows you to assign a required password for a folder, which is separate from your WordPress password. Các máy chủ web Apache có được xây dựng trong cơ chế cho phép bạn chỉ định một mật khẩu được yêu cầu cho một thư mục, được tách biệt với mật khẩu WordPress của bạn.

Quick Blog Security Tips Mẹo nhanh Blog An

Security is important enough that I felt it necessary to include some extra tips here. An ninh điều quan trọng là đủ mà tôi cảm thấy cần thiết để bao gồm một số mẹo thêm ở đây. This is by no means a complete list, but you should look into them anyway. Điều này là do không có nghĩa là một danh sách đầy đủ, nhưng bạn nên nhìn vào chúng anyway.

  • Make sure you are running the latest version of WordPress and all your plugins. Hãy chắc chắn rằng bạn đang chạy phiên bản mới nhất của WordPress và tất cả các bạn bổ sung.
  • You should consider subscribing to Bạn nên xem xét việc đăng ký vào BlogSecurity.net BlogSecurity.net , a blog that attempts to cover security news about blogging platforms. , Một blog mà cố gắng để che tin bảo mật về nền tảng blog.
  • Make sure that your file permissions are set correctly according to the Hãy đảm bảo rằng quyền của tập tin được đặt đúng theo WordPress guidelines WordPress hướng dẫn . .
  • Make sure you are using tough passwords for all accounts. Hãy chắc chắn rằng bạn đang sử dụng các mật khẩu cứng rắn đối với tất cả tài khoản.
  • Make sure that you are backing up your entire WordPress installation and database. Hãy chắc chắn rằng bạn là sao lưu toàn bộ tiến trình cài đặt WordPress của bạn và cơ sở dữ liệu.
  • Lock down your administration folder with .htaccess rules (covered here) Khóa cửa xuống thư mục quản trị của bạn với. Htaccess quy (bao gồm tại đây)

Assigning a Password to wp-admin Directory Manually Gán một mật khẩu để wp-admin Directory thủ công

Create a file named .htaccess in your wp-admin directory, and add the following contents: Tạo một tập tin tên htaccess trong wp của bạn.-Admin thư mục, và thêm các nội dung sau đây:

AuthName “Restricted Area” AuthName "Restricted Area"
AuthType Basic AuthType Basic
AuthUserFile /var/full/web/path/.htpasswd AuthUserFile / var / đầy đủ / web / path / .htpasswd
AuthGroupFile /dev/null AuthGroupFile / dev / null
require valid-user yêu cầu người dùng hợp lệ

You'll need to adjust the AuthUserFile line to use the full path to the .htpasswd file we'll create in the next step. Bạn sẽ cần phải điều chỉnh dòng AuthUserFile sử dụng đường dẫn đầy đủ đến htpasswd. Tập tin chúng tôi sẽ tạo ở bước kế tiếp. You can find the full path by using the pwd command from the shell prompt. Bạn có thể tìm thấy đường dẫn đầy đủ bằng cách sử dụng lệnh pwd từ dấu nhắc trình bao.

Next you'll need to use the htpasswd command line utility to create the password file. Sau đó, bạn sẽ cần phải sử dụng tiện ích dòng lệnh htpasswd để tạo tập tin mật khẩu. I would also advise that you use a different user account and password than you use for your WordPress installation. Tôi cũng sẽ khuyên bạn nên sử dụng một tài khoản người dùng và mật khẩu khác nhau hơn bạn sử dụng để cài đặt WordPress của bạn.

$ htpasswd -c .htpasswd myusername $ Htpasswd-c. Htpasswd myusername
New password: Mật khẩu mới:
Re-type new password: Nhập lại mật khẩu mới:
Adding password for user myusername Thêm mật khẩu cho người sử dụng myusername

You'll want to make sure you are in the directory specified by AuthUserFile, and change “myusername” to something unique for your site. Bạn sẽ muốn chắc chắn rằng bạn đang ở trong thư mục được chỉ định bởi AuthUserFile, và thay đổi "myusername" cho một cái gì đó duy nhất cho trang web của bạn. This will create a file with contents similar to the following: Điều này sẽ tạo một tập tin có nội dung tương tự như sau:

myusername:aJztXHCknKJ3. myusername: aJztXHCknKJ3.

At this point you should be prompted for a password when you navigate to your WordPress administration panel. Tại thời điểm này, bạn nên được nhắc nhập mật khẩu khi bạn tìm đến bảng quản trị của WordPress. You'll notice that “Restricted Area” is the text from the .htaccess file, which could be changed to anything else. Bạn sẽ nhận thấy rằng, "Restricted Area" là văn bản từ tập tin htaccess., Mà có thể được thay đổi bất cứ điều gì khác.

hình ảnh

If you get a server error instead, you should probably remove the .htaccess file and start over. Nếu bạn nhận được một lỗi máy chủ thay vào đó, bạn có thể cần phải loại bỏ các tập tin. Htaccess và bắt đầu hơn.

Lastly, you should make sure that you remove write permissions to both files with the chmod command as one more layer of security. Cuối cùng, bạn nên chắc chắn rằng bạn loại bỏ write cho cả tập tin với lệnh chmod như là một trong nhiều lớp bảo mật.

chmod 444 .htaccess chmod 444. htaccess

chmod 444 .htpasswd chmod 444. htpasswd

.htaccess Password File Generator htaccess Password. tệp phát điện

There's a great tool from Dynamicdrive that will do all the hard work of creating the file for you. Có một công cụ tuyệt vời từ Dynamicdrive mà sẽ làm tất cả những công việc khó khăn của việc tạo ra các tập tin cho bạn. 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. Điều này đặc biệt hữu ích nếu bạn không có quyền truy cập vỏ đến máy chủ của bạn, vì bạn chỉ có thể tải lên những tập tin qua FTP client SFTP / bạn.

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

You should still make sure that you remove write access once the files are uploaded. Bạn vẫn cần phải chắc chắn rằng bạn loại bỏ viết một lần truy cập các tập tin được tải lên.

This article was originally written on 12/5/07 Tagged with: Bài viết này ban đầu được viết ngày 12/5/07 Tagged với: Geek Stuff Geek Stuff

Daily Email Updates Email cập nhật hàng ngày

You can get our how-to articles in your inbox each day for free. Bạn có thể làm thế nào chúng tôi vào các bài viết trong hộp thư của bạn mỗi ngày miễn phí. Just enter your name and email below: Chỉ cần nhập tên và email của bạn dưới đây:


Name: Tên:
Email: Email:

Comments (8) Bình luận (8)

  1. John John

    This is great advice. Đây là lời khuyên tuyệt vời. It should be pointed out, however, that not everyone has access to create a .htaccess file with password. Cần chỉ ra, tuy nhiên, rằng không phải tất cả mọi người có quyền truy cập để tạo một tập tin htaccess với mật khẩu.. Many hosting services don't give their users this kind of access. Nhiều dịch vụ lưu trữ không cung cấp cho người dùng của họ loại truy cập.

  2. JasonS JasonS

    This may be a stupid question, I don't know. Đây có thể là một câu hỏi ngu ngốc, tôi không biết. I recently signed up for a new Wordpress account. Gần đây tôi đã đăng ký một tài khoản Wordpress mới. The blog is hosted on their server. Blog này được lưu trữ trên máy chủ của họ. I didn't download anything or install it on my web server. Tôi không tải về bất cứ điều gì hoặc cài đặt nó trên máy chủ web của tôi. So, is any of this necessary? Vì vậy, bất kỳ này là cần thiết?

  3. John John

    Do you mean Wordpress.com? Bạn có nghĩa là Wordpress.com? If so then you won't be able to do this. Nếu vậy thì bạn sẽ không thể làm điều này.

  4. Jake Jake

    @JasonS: This refers to Wordpress.org, which is the actual CMS software. @ JasonS: Điều này nói đến Wordpress.org, được CMS thực tế phần mềm. You are thinking of Wordpress.com, which is a free hosting service built around the Wordpress.org CMS. Bạn đang nghĩ đến Wordpress.com, mà là một dịch vụ lưu trữ miễn phí xây dựng xung quanh CMS Wordpress.org. So no. Vì vậy, không có. Most free blog hosts will not allow you to mess with .htaccess. Hầu hết các chủ nhà Việt blog sẽ không cho phép bạn để gây rối với. Htaccess.

  5. john parsons john Parsons

    Trying to set up a password protection with .htaccess, can find no clear instructions of correct path in AuthUserFile. Đang cố gắng thiết lập một bảo vệ bằng mật khẩu. Htaccess, có thể tìm thấy không có hướng dẫn rõ ràng về đường dẫn chính xác trong AuthUserFile. Is the following style of path correct Là phong cách sau đây của đường dẫn chính xác

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

    every tutorial gives examples such as mọi hướng dẫn cho các ví dụ như
    /var/full/web/path/.htpasswd / var / đầy đủ / web / path / .htpasswd
    or hoặc
    /home/file/…. / home / file / ....

    which make no sense to me. mà làm cho không có ý nghĩa với tôi.

    Thanks Cảm ơn

  6. john.s john.s

    Examples like /var/path/.htpasswd are for Unix-like systems (Linux). Ví dụ như / var / path / .htpasswd là dành cho Unix (Linux).

    This only works on Linux and Unix-like systems, it DOES NOT work on Windows. Điều này chỉ hoạt động trên Linux và Unix, nó DOES làm việc KHÔNG trên Windows.

  7. khokon khokon

    is it possible in joomla? là nó có thể trong Joomla?

  8. abhi abhi

    Thanks for the good info, it wil protect WP Cám ơn những thông tin tốt, nó bảo vệ wil WP


Our Friends Bạn bè của chúng tôi
Getting Started Bắt đầu


About How-To Geek Giới How-To Geek
What Is That Process? Quá trình đó là gì?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
wmpnscfg.exe wmpnscfg.exe
rundll32.exe rundll32.exe
wfcrun32.exe wfcrun32.exe
Ipoint.exe Ipoint.exe
Itype.exe Itype.exe
Wfica32.exe Wfica32.exe
Mobsync.exe Mobsync.exe
conhost.exe conhost.exe
Dpupdchk.exe Dpupdchk.exe Adobe_Updater.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. Bản quyền © 2006-2009 HowToGeek.com. All Rights Reserved. Tất cả các quyền.