Sometimes it is useful to restrict access to some subset of the pages on your website with a password. The directions below assume that you are familiar with UNIX files and commands; can move comfortably in the UNIX directory tree; and can use a text editor such as Pico.
Warning: This level of password protection doesn't mean that your files cannot be accessed if you're not careful. For example, if you enter the username and password to access a file in the protected directory that you create and then leave the browser up and going, anyone can access another file in the same directory as long as the browser software remains open. Similarly, if a user in a lab accesses the protected directory with username/password, surf other Internet sites, and leave the lab, the next user can obtain access to the protected site by using the "Back" button if the browser software has not been closed and re-launched.
Here's how it will work: To limit access to files on your website, you need to place them in a password-protected directory. The password you will create actually protects the contents of the directory as a whole. Once you have password protected access to your directory, anyone who tries to browse files there will be prompted for a username and password--this username and password is NOT the same as your or any other user's Artsci login and password.
Before beginning: In the instructions below, any information you need to enter will be shown in bold inside the blue terminal box. The instructions will illustrate user tsmith's account, and the example command line shown for each step will look like the command line you will see in your own account. The instructions password protect the directory called private. The username required for access to this directory is student. You should make note of the name of the directory you wish to protect in your own account and decide on a user name to substitute for student below.
Let's get started:
First you will need to create a new directory to contain the protected files. This is the directory that will be password protected.
NOTE: you must create the file exactly as shown below including upper and lowercase letters and spaces, substituting your own path obtained in step 2 above. This is where you will need to paste the path that you copied before (go up to 'Edit' drop down menu and choose 'Paste'). Also substitute the username that you created in step 2 to use for student below. If you have additional usernames, add them on additional separate lines.
NOTE: THE MESSAGE:'This File is protected with a password' MUST BE IN QUOTES !
AuthUserFile/home/artsci/students/s/tsmith/public_html/private/.htpasswd
AuthName "This File is protected with a password"
<Limit GET>
AuthType Basic
</Limit>
require user student
You are now finished!
Here is how to change the password that you just setup:
You will now be prompted to type in the new password and retype it for confirmation.