sils home | site map | Searchcontact us | Searchsearch
ITRC

 Password Protect Web Pages On Ruby and Isis


Table of Contents

Isis
Ruby

The following instructions for user authentification use the scripts that both Isis and Ruby run to make this process easier. Instructions on how to password protect your Web site manually can be found [ http://sils.unc.edu/itrc/its/faq.php?id=4705 ] here. This page covers how to protect access to Web pages by requiring a username and password. There are instructions for how to do this on Isis (UNC's Web server) and Ruby (the SILS Web server). If you're just getting started with your Web site, please see [ http://help.unc.edu/1848 ] ITS's help page for more information about using Isis or the SILS page on [ http://sils.unc.edu/itrc/its/faq.php?id=4617 ] developing Web pages on Ruby.

 Isis

  1. Log on to your Isis account through SecureShell (or another SSH application) and choose 6. enter a temporary ksh session.

  2. Change to your public_html directory. ( cd public_html )

  3. Either create a new directory to password protect ( mkdir newdirectory ) or change to the one you want to protect ( cd ). Choose a subdirectory of public_html; otherwise, your entire public_html will become password-protected.

  4. Type protect and hit Enter. This will activate a script that automatically creates several files for you.

    • Enter Yes if prompted with "Would you like to continue?"

    • Choose 1. Restrict pages based on users' Onyen and password or 2. Restrict pages by using one user name and password designated by you to protect the current directory.

    • Choose 5. Remove restriction to your pages to unrestrict a password-protected directory.

    • Choose 8. Exit this program to return to the command prompt.

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.

 Ruby

If you need to learn more about the Unix shell environment, try ITS's tutorial on [ http://help.unc.edu/5288 ] basic Unix.

  1. Log on to your Ruby account through SecureShell (or another SSH application).

  2. Change to your public_html directory. ( cd public_html )

  3. Either create a new directory to password protect ( mkdir newdirectory ) or change to the one you want to protect ( cd ). Choose a subdirectory of public_html; otherwise, your entire public_html will become password-protected.

  4. At the prompt, type htdirpass.pl .

  5. When prompted, enter the user name and password that you would like your users to use.

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.