Created
June 5, 2021 10:59
-
-
Save jack2jm/b98af67e8e18460c85465e2085c8eac1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. sudo apt install apache2-utils | |
| (https://sleeplessbeastie.eu/2020/02/26/how-to-generate-password-digest-for-basic-authentication-of-http-users/) | |
| Create .htaacess file | |
| 2. htpasswd -c /home/pwww/.htpasswd jerry | |
| {Following command will creates a new file and stores a record in it for user jerry. The user is prompted for the password. If the file exists and cannot be read, or cannot be written, it is not altered and htpasswd will display a message and return an error status.} | |
| 3. Change or update password | |
| htpasswd /home/pwww/.htpasswd-users tom | |
| {***The user is prompted for the password.**} | |
| 2. paste this code to .htaaccess | |
| AuthType Basic | |
| AuthName "restricted area" | |
| AuthUserFile /var/www/html/.htpasswd | |
| require valid-user | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment