Search | Directories | Reference Tools
UW Home > UWIN > Computing and Networking > Web > Web Publishing > Controlling Access > Protection by UW NetID 

Authorizing UW NetIDs by Groups

Summary

This article provides instructions for password protecting a site using a group of UW NetIDs maintained in a separate group file. This technique facilitates the day-to-day upkeep when you're working with dozens of UW NetIDs. The instructions illustrate a simple example, but more advanced methods are described at the end of the article.

Instructions:

For the purpose of these instructions, imagine the following people:

Name Classification UW NetID UW Email Address
Josh G. Student joshg joshg@u.washington.edu
Sally T. Student sallyt sallyt@u.washington.edu
Jordan C. Student jcat jcat@u.washington.edu
Chloe S. Faculty chloes chloes@u.washington.edu
Kate B. Faculty katebeck katebeck@u.washington.edu
Pablo V. Staff pveron pveron@u.washington.edu
  1. Log in to your Homer or Dante account with Tera Term or another terminal emulator.

  2. Press the O key for Other, then press the W key to drop into the Web development environment.

  3. At the prompt, enter the following command to change directories to your Web directory:

    cd public_html

    If you want to password protect a subdirectory rather than your whole Web site, change directories to the subdirectory you want to protect. For example:

    cd private
  4. At the prompt, enter the following command to create a .htgroup file in the current working directory:

    pico .htgroup

    Note: You can create the .htgroup file in your Web directory, one of its subdirectories, or, if you want to get fancy, in the Web directory of another account. For simplicity, this example uses a .htgroup in the same directory as the .htaccess file.

  5. Define groups of UW NetIDs in the .htgroup file, one group per line, like so:

    friends: joshg sallyt
    peers: chloes katebeck pveron
    others: jcat

    Be sure to enter the name of each group, followed by a colon, and then list the UW NetIDs that make up the group, separating the names with spaces.

  6. Save the .htgroup file (in Pico use ^X).

  7. At the prompt, enter the following command to create a .htaccess file in the current working directory:

    pico .htaccess
  8. Add the following text to this file:

    AuthType UWNetID
    AuthGroupFile .htgroup
    require group friends peers
  9. Save the .htaccess file (in Pico use ^X).

  10. You're done! Confirm that password protection is working by opening your Web site with a Web browser.

Notice who's given access in this example. The .htaccess file requires members of the friends or peers groups, as defined in the .htgroup file. Jordan C. isn't allowed access because he's not in either of these groups. Poor Jordan.

The AuthGroupFile directive specifies the location of the .htgroup file. Here it is the same directory as the .htaccess file. (Hint: if your .htgroup file is in some other directory, use AuthGroupFile ~someid/path/.htgroup where "someid" is the account holding the .htgroup file and "path" is the relative path, as you would see in a URL, to the directory containing the .htgroup file.)