Password
Protected Directories
You
would use this feature if you want to password protect a directory
on your site. This is a feature which requires some experience with
using telnet.
Attention FrontPage Users: If
you are a FrontPage user you can password protect directories from
within the program. Please consult your user manual or online user
guides for more information. Please do not attempt to alter your
.htaccess file while FrontPage extensions are installed for your
server. This may cause your account to become inoperable.
Installation
Instructions
- SSH/Telnet
in, and login
- Navigate
to the directory you want to password protect.
- Create
the .htaccessfile (with the dot), it should contain the followinglines:
# .htaccess file
order allow,deny
allow from all
require valid-user
Authname DirectoryName
Authtype Basic
AuthUserFile /users/web/yourlogin/web/directorytoprotect/.htpasswd
- Replace
yourlogin and directorytoprotect as appropriate.
- Now
you must create the .htpasswd file using the htpasswd tool.
Using SSH/ telnet, move to the folder that you specified within
the .htaccess file as "AuthUserFile" (/users/web/yourlogin/web/directorytoprotect/)
a. Type the following command to create the file
and add a user:
/usr/bin/htpasswd -c .htpasswd username
b. You will be prompted for the users' password
twice.
- If
you need to add additional users to the file, use the command
above without the " -c".
|