deadlock Message Board
[ March Full List | Reply ]

Quick 'n' dirty .htpasswd tutorial
From Jim on 21 March '99
replying to Building a password site posted by Nancy

Telnet into your account, then enter this command:

htpasswd -c .htpasswd nancy

You'll be prompted to enter a password, then repeat it. Once you've
done that, your password will be set up.

In order to "make the password work" you need to put a file called
.htaccess into your private directory. You can just use your normal
FTP program, or whatever you usually use to upload your Web pages.

The contents of your .htaccess file need to look something like this:

AuthUserFile /home/nancy/.htpasswd
AuthGroupFile /dev/null
AuthName Nancy_Private
AuthType Basic
<Limit GET POST>
require user nancy

Notes about the above:

AuthUserFile must be the path to the
.htpasswd file - it'll be in your home directory, the one where
you arrive when you log into your account.

AuthName can be anything, it'll be displayed on the password entry

require user nancy - only user nancy will be able to enter your
private directory. You can add as many user/password combinations
to your .htpasswd file as you like, so you can give different users
access to different directories. If you want "any" registered
user to be able to enter your private directory, put:

require valid-user

IMPORTANT: to add new users to your .htpasswd file, do this:

htpasswd .htpasswd nancy2

(note: do not use -c otherwise you'll create a new .htpasswd file
and your old user will be deleted).

Hope this helps...

Reply to this message

Required Details
Your name:

Optional Details
Home page title:
Home page URL:
(if you'd like to receive
automatic replies by email)

Your Message