INLS161-002 | Spring 2017

Task: Protect Directory


Use a terminal connection and command line instructions to create a password protected directory

Log on to your Opal account using a terminal connection program and enter a temporary shell session at the command prompt (it should be

$

in Unix).

Change to your public_html directory:

cd public_html

Create a new subdirectory within public_html to password protect:

mkdir protected

The new directory is named "protected", because you should get into the habit of using consistent and logical directory and file names.

Be careful not to inadvertently password-protect your public_html directory.

Use:

pwd

to see where you are. If you are not in your new directory, use:

cd protected

to go to it.

Once you are sure where you are, type:

htdirpass.pl and hit Enter

This will activate a script that automatically creates several files for you.

Verify that you are in the directory you want to protect and follow the instructions on the screen.

The program creates two files in the directory you are protecting: .htaccess and .htpasswd

You won't see these files on a regular

ls

command, you must type

ls -a

Don't delete the files unless you want to remove the password protection, which you don't on this directory because this is graded.

Quick Links

Instructor

Lawrence Jones

Office hours by appointment.