BU324 MIS

Exercise #5

Creating password protection on your files can be accomplished using the Password  Documentation ripped off from Ken Kochien of PSC/ITS.  This will create a single common "User Name" and "Password" combination. You will be protecting only one sub-directory within home, and will have only one username/password combo. 

Note: In the directions below, username is a variable of your choice, and pathname is a predetermined variable that represents the address of your login directory.  This means, for example,  that you don't really type "pathname", but you type what the actual pathname is.

To get set up:
  login
% pwd   [this will show you your pathname/]
% cd Home  [moves you into your Home directory]
% mkdir Quiz  [make a sub-directory within Home]
% chmod 755 Quiz  [make your new sub-directory public]
% cd Quiz  [moves you into your Quiz sub-directory]
% pico .htaccess [creates a file called .htaccess and gives you the blank editing page]

Enter the following commands in the pico editor [see also Password documentation]

AuthUserFile /pathname/.word
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic

<Limit GET>
require user username
</limit>

Note: Change the word username in the line "require user username" to be whatever single common username you chose.

Ctrl-X, Y, Enter [to exit pico editor]

Then enter the following Unix commands:

% chmod 644 .htaccess  [This makes .htaccess public]
% htpasswd -c /pathname/.word username [This runs the password program, during which you'll be prompted for a password.  Note: the "-c" creates the .word file.  If you've run this once already, then the .word file exists, and you should eliminate the "-c" from subsequent running of this command].

% pico newfile.html [This will create a new file to look at.  Put some junk into the file for a test.  Save, Get out of pico]
% chmod 644 newfile.html


% cd ~ [moves you to your login directory]

% chmod 644 .word [makes the .word file public]

Get into your favorite browser and go to http://oz.plymouth.edu/~j_doe/Quiz/newfile.html to test to see if your new password protection scheme works.  If it does, then send me the username/password protection combo so that I can check it out. 
Good luck