jump to another section | Index |
To give password protection to a directory, you first need to create a file called ".htaccess" in the directory to be protected. The contents of this file should be something like:
AuthUserFile /home/me/.htpasswd
AuthGroupFile /dev/null
AuthName "photo gallery"
AuthType Basic
<Limit GET>
require valid-user
</Limit>
Change the AuthUserFile to where you want to keep the password list (typically in your home directory), and change AuthName to what you want as the title of the pop-up window asking for the username/password. Be sure to use ASCII mode when transferring this file in ftp.
Next, generate encrypted passwords for all users of this private directory. This can be done here. Cut and paste its output into your .htpasswd file to add accounts. For example, the username test with password test would look like: test:teH0wLIpW0gyQ
Users should be added one per line. Remember to use ASCII mode for this file too.