Claim your Biolink Click Here
1 like 0 dislike
636 views
Password protecting the website with a .htaccess file
in Education & Reference by (830 points) | 636 views

1 Answer

0 like 0 dislike
Best answer

This article explains how to password protect your folder through SSH via developing an .Htaccess and .Htpasswd file. The following steps are covered in this article.

Creating the .htpasswd file
Creating the .htaccess file

Log into your server via SSH.
Create an .Htpasswd document in the listing you wish to password defend using the the htpasswd application. For the first person, say USERNAME, run the subsequent:

[root#] htpasswd -c /var/www/html/test/.htpasswd USERNAME

It will ask a new password

Enter the password for the user. This creates a password for a user named 'USERNAME'. The code in your .htpasswd file will show the encrypted password like this:

USERNAME:GdyerBV64bdj=

Creating the .htaccess file

[server]$ vi .htaccess

#Protect Directory
AuthName "Dialog prompt"
AuthType Basic
AuthUserFile /var/www/html/test/.htpasswd
Require valid-user
by (4.6k points)

Related questions

1 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
asked Jun 27, 2019 in Education & Reference by Simmi (830 points) | 277 views
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,308 questions
1,469 answers
568 comments
4,809 users