Hướng dẫn đặt mật khẩu khi truy cập file để tăng tính bảo mật

Currently Hostvn recorded with some customers using file hosting hacked into the website administrator login affects stable operation of the website. This article will guide you secure log file by setting a password when accessing this file 2 following simple steps:

-Step 1: Configure the .htaccess file

You add the following code to your .htaccess file:

ErrorDocument 401 "Deny access"
ErrorDocument 403 "Deny access"
<FilesMatch "wp-login.php">
AuthName "Check the log"
AuthType Basic
AuthUserFile /home/ten_user/public_html/.htpasswd
Require valid-user
</FilesMatch>

Inside:

ErrorDocument 401 "Deny access"
ErrorDocument 403 "Deny access"

Show text “Deny access” if a user enters a wrong account and password that steps 2 You will put.

<FilesMatch "wp-login.php">

File names are protected access, here I take the example with WordPress source code, the file will be wp-login.php. For each different source will have 1 different log file, You replace this file by log files in the source code of the customer.

AuthUserFile /home/ten_user/public_html/.htpasswd

The path to the file containing the password that you will put in step 2. You replace ten_user into their account name. Often there will be ten_user 8 characters, assuming your hosting with domain name is baovetruycap.com the user name will often be baovetru. So now would be the right path:

AuthUserFile /home/baovetru/public_html/.htpasswd

– Step 2: Create password file .htpasswd
You access the following link to create file .htpassswd:
http://www.htaccesstools.com/htpasswd-generator/
Next you fill in information about Username, Password then press Create .htpasswd file:
You note, this information should be easy to remember but hard to guess you with others to secure the effective, I suppose in this set Username is camtruycap with 1 your password that only I know:

htpasswd

Next will be 1 the code generated after encryption password of the customer. The now we need to do is create 1 .htpasswd file and then paste this code into:

htpasswd2

Thus we have completed the log file protection. You can also protect many other files that you want by following 2 step above. If you have created .htpasswd files to protect 1 The first file, then from the second file 2 onwards, You just add the code is generated in step 2 .htpasswd file into it. You note, each code is shown on 1 current.
Wishing you success in protecting important files in your source code!

VN:F [1.9.22_1171]
Rating: 3.0/5 (2 votes cast)

Hướng dẫn đặt mật khẩu khi truy cập file để tăng tính bảo mật, 3.0 out of 5 based on 2 ratings