Basic Authentication 3

Getting Started with Basic Authentication

You need:

  1. Password file
  2. Group file (optional)
  3. A <Location> or <Directory> section containing require directive

Creating Simple Password File

  % htpasswd -c /www/etc/passwd lstein
  New password: ********
  Re-type new password: ********
  Adding password for user lstein
  % htpasswd /www/etc/passwd john
  New password: ********
  Re-type new password: ********
  Adding password for user john
  % htpasswd /www/etc/passwd gloria
  New password: ********
  Re-type new password: ********
  Adding password for user gloria

The resulting file is human-readable:
lstein:sC3k/YTX..t3Y
john:WN28x0ahEZFJA
gloria:c23xWxiuRtFdU

Creating Simple Group File

  web-admin: lstein
  authors: lstein john fred wendy
  guests: gloria

Important: Put the password and group file(s) outside document tree!


<< Previous Contents >> Next >>

Lincoln D. Stein, lstein@cshl.org
Cold Spring Harbor Laboratory
Last modified: Sun Jul 16 21:12:33 PDT 2000