Password
Protecting a site with Multiple Names and Passwords
Important Note: These instructions (as well
as the instructions under ECAT) relate to password protecting
web directories on the College of Agriculture's AgServer. If
you are working on another system, you will have to contact
the technical support team or administration of that system's
web server for instructions and to find out if they support
password protecting of user web directories.
The instructions for creating a password
protected directory in your web site with multiple names
and passwords are the
same as password protecting a directory with a single name
and password, but with slight modifications. If you
haven't already read the instructions on Password
protecting a directory from web display, please do so
now.
- Follow Steps
1-3 from Password protecting a directory
from web display.
- This will create a single name and password for your
directory.
-
- Modify Step
2.
- To create multiple names, simply add them to the
.htaccess file
like the first name.
- Your file will look something like this:
-
-
AuthUserFile /your/directory/here/.htpasswd
AuthGroupFile /dev/null
AuthName "Secure Document"
AuthType Basic
<LIMIT GET PUT POST>
require user username1
require user username2
require user username3
require user etc
</LIMIT> |
-
- Modify Step
3.
- Assign passwords to each username using the
htpasswd command.
- Follow Step 3 to assign a password to
your first username. Then
use the same command to assign passwords to additional
names, but without the
-c option, for
each additional name. The -c option tells
the htpasswd command to create a file (named
.htpasswd) with an encrypted password for a username. Without
the -c option, the command will add a password
to the already existing file specified.
- So your commands should look something like this:
-
>htpasswd -c .htpasswd username1
>htpasswd .htpasswd username2
>htpasswd .htpasswd username3
>htpasswd .htpasswd etc
-
- Refer to Steps
4-7 on Password protecting a directory
from web display to complete this process.
- Particularly in Step 5, your
.htaccess & .htpasswd files
need to be world readable in order for this to work.
Further questions may be directed to the CALSNet Lab team.
|