Basics: Clients | Reset User and Password


Task 01.05c Password Protect a Directory (if you have forgotten your password)

If you have forgotten your user name or password, or if you have accidentally deleted your password protection, use a terminal connection and command line instructions to re-create a password for your protected directory

Log on to your Opal account using a terminal connection program. For Windows users this will be the Secure Shell Program and for Mac users this will be the Terminal program.

Change to your tasks directory that is your public_html directory with this one command:

cd public_html/tasks

Be careful not to inadvertently password-protect any other directory.

Use

pwd

to confirm that you are in the

public_html/tasks
directory.

Decide what your user name and password will be now and write it down or save it in a file on your computer. Once you are sure where you are, type

htdirpass.pl

and hit Enter. This will activate the same script that you used previously. Where you see onyen in the directory name, it will be your actual onyen, you will not see the word onyen)

You are currently working in: /fs1/home/onyen/public_html/tasks 
All changes will be made to this directory.
If you wish to alter another directory, please quit (ctrl-c) and run this script from the proper location.
Please enter the username you want to secure the folder with: (the one you decided on)
Please enter the password with which you will secure the folder: (the one you decided on)
Adding password for user *****
Thank you.

The program will again create the two files in the directory you are protecting: .htaccess and .htpasswd

It will overwrite the files that you used before; you don't have to delete them first. (If you had deleted the file it will just create new ones.)
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.

Send me an email telling me the name of your updated user id and the new password for your tasks directory

Quick links

opal login: ssh ONYEN@opal.ils.unc.edu
opal password: ONYEN password

Instructor

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Office hours by appointment.