/ Published in: Bash
Good info here too: http://www.ilisys.com.au/support/linux-password-protect/
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Step 1 - Create .htaccess file in folder you want to protect, copy the code and paste the code below, and then set server path to the file AuthUserFile /path/to/.htpasswd AuthName "Restricted Area" AuthType Basic Require valid-user Step 2 - Open Terminal, go to the directory you want to protect, and enter the following (changing the username to whatever you want). Enter the password upon prompting. htpasswd -c .htpasswd username
URL: http://ag.arizona.edu/ecat/web/password-protect.html