Add Text Description Here



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:

  1. You'll need to generate two files with "pico" or any simple text writer (jove, vi, etc). Name the files as follows: ".htaccess" and ".htgroup"
  2. The .htaccess and .htgroup files should be created at the directory level which you want to be password protected.
  3. To create passwords you will need to type the following instruction for each user: /web/bin/htpasswd.pl -u username. As result a ".htpasswd" file will be generated by the system.
Following are 14 steps with graphical instructions:

STEP 1

Exit the menu window (i.e. image below)

[1. Exit the MENU window]

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

[2. cd web, cd directory, ls -la]

STEP 3

Let's create a .htaccess file through pico (unix text editor): pico .htaccess

[3. Create a file with name .htaccess]

STEP 4

Type the following information in the .htaccess file:

AuthUserFile /web/instruct/login_name/folder/.htpasswd
AuthGroupFile /web/instruct/login_name/folder/.htgroup
AuthName ByPassword
AuthType Basic

<Limit GET>
require group MyGroup
</Limit>

where:

/login_name/ = is your login name.

/folder/ = is the folder or directory where you are and you want to have password protection.

[4. Type the information below]

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

[5. Exit the MENU window]

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.

[6. Exit the MENU window]

STEP 7

Now, let's create a .htgroup file through pico (unix text editor): pico .htgroup

[7. Exit the MENU window]

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.

[8. Exit the MENU window]

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. 

[9. Exit the MENU window]

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.

[10. Exit the MENU window]

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.

[11. Exit the MENU window]

STEP 12

The system will prompt you to enter the user's password (i.e. image below)

[12. Exit the MENU window]

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)

[13. Exit the MENU window]

STEP 14

To ensure that now we have three documents with the names:

.htaccess
.htgroup
.htpasswd

we need to list the content of our directory (i.e. image below).

[14. Exit the MENU window]

[phonebook][site search][NDSU home page]


Prospective students may schedule a visit by calling 1-800-488-NDSU.
NDSU Webmaster

Last Updated: Wednesday, October 21, 1998
Published by North Dakota State University