www.inkompetent.de/ knowledge base/ software/ htpasswd encrypt
Problem:
You want to protect directories within your
webspace with password and username.
You might also want to encrypt strings for other
purposes.
Solution:
This solution should work for any apache-style-webserver:
user. The line consists of the username followed by a
colon and the encrypted password. It should look like
this:
username:encryptedPassword
the password here.
4 lines (if they are not already in the file):
AuthType Basic
AuthName "Restricted Directory"
AuthUserFile /absolute/path/to/the/directory/of/.htpasswd
require valid-user