Securing A Traditional Class Web Folder

Use the following basic instructions to password-protect a traditional class web page.  Be sure to replace "abc123" with your actual class designation, and "Winter16" with the quarter you're teaching, and "password" with a secure password that you will give students to access the folder.

  1. Create the folder you want to secure:

    mkdir /cse/classes/abc123/Winter16/PRIVATE
  2. Change into that folder:

    cd /cse/classes/abc123/Winter16/PRIVATE
  3. Create a .htpasswd file:

    htpasswd -b -c .htpasswd abc123 password
  4. Create a .htaccess file with the following contents:

    AuthType Basic
    AuthName "ABC123 Class Web Page" AuthBasicProvider file AuthUserFile /cse/classes/abc123/Winter16/PRIVATE/.htpasswd require valid-user
  5. Make sure the permissions are set correctly:

    chmod 755 /cse/classes/abc123/Winter16/PRIVATE
    chmod 644 /cse/classes/abc123/Winter16/PRIVATE/.htpasswd
    chmod 644 /cse/classes/abc123/Winter16/PRIVATE/.htaccess

Then you can test your secure folder at a URL similar to the following:

https://classes.soe.ucsc.edu/abc123/Winter16/PRIVATE/