![]() |
|
|
How To Set a Password into a Web Folder (using TELNET) |
|
| SUMMARY
The following document explains graphically how to set up passwords and users to access a web directory. IMPORTANT: Since you will be working at the root level of your directories make sure to follow the instructions correctly. If you fail to follow the instructions you may loose files, information or lock your self out of a directory. The 1-2-3 summary steps to set users and passwords to a directory is basically:
STEP 1 Exit the menu window (i.e. image below)
STEP 2 Go to your WEB directory by typing: cd web Go to the directory you would like to have password protected: cd directory List all your files in that directory: ls -la
STEP 3 Let's create a .htaccess file through pico (unix text editor): pico .htaccess
STEP 4 Type the following information in the .htaccess file: AuthUserFile /web/instruct/login_name/folder/.htpasswd
<Limit GET>
where: /login_name/ = is your login name. /folder/ = is the folder or directory where you are and you want to have password protection.
STEP 5 The image below is an example of the information that I typed in an .htaccess file: My directory is: ndsu (there are to main directories: ndsu and instruct) My login name is: herrera My directory that I want to protect is: test
STEP 6 To save this .htaccess file you will type ctrl - O and it will prompt you with the name. You will just hit the return key.
STEP 7 Now, let's create a .htgroup file through pico (unix text editor): pico .htgroup
STEP 8 Type the following information in the .htaccess file: MyGroup: username1 username2 username3 where: username1, username2 and username3 are the users' name that you want to create and/or have access to this directory.
STEP 9 The image below is an example of the information that I typed in an .htgroup file: Mygroup: dummy where my user's name is dummy. To save this .htgroup file you will type ctrl - O and it will prompt you with the name. You will just hit the return key.
STEP 10 To make sure that we have two files (.htaccess and .htgroup) in our protected directory let's type: ls -la You should see the two file names listed.
STEP 11 To create a password for each user wou will need to type the following: /web/bin/htpasswd.pl -u username where username is the user's name.
STEP 12 The system will prompt you to enter the user's password (i.e. image below)
STEP 13 Once that you type the password you will need to hit the return key. The password will be encrypted and as result a ".htpasswd" file will be generated by the system. (i.e. image below)
STEP 14 To ensure that now we have three documents with the names: .htaccess
we need to list the content of our directory (i.e. image below).
|
|
|
NDSU Webmaster
Last Updated: Wednesday, October 21, 1998 Published by North Dakota State University |