Description: is a Perl script that automates adding users to a .htaccess and .htpasswd password control scheme. The user initiates the authorization request by filling out a CGI form submitting his name and e-mail address. If there is a list of approved users, the userís name is checked against that list before access is granted. If the user is among the list of approved users, or if everybody is allowed access, then a random password is generated and sent to the user at the specified e-mail address. A user name is also generated for the user from the e-mail address.

This script is written to be used with the .htaccess access control scheme using ODBM database, but can be modified to use the regular version of .htaccess and .htpasswd fairly readily.


You have to have access to a web server to run this script. The web server would preferably be running any variant of UNIX, such as Linux or BSD. (NT web servers with Perl interpreter can be used, but youíre on your own!) You must have the capability to execute CGI scripts (check with your ISP to make sure). And you must possess a working knowledge of the UNIX file system, HTML coding, and how to implement a CGI script. uses the module, which was written by Steven E. Brenner. is usually loaded with the standard Perl implementation. However, if itís not available on your server, you can download your own copy of from the Home Page.


  1. Obtain a copy of the script using one of the options below.
  2. Install in your cgi-bin directory. You may have to rename the script to verify.cgi depending on the configuration of your server software. Set the permissions of or verify.cgi to world-readable and executable (0755).
  3. Edit or verify.cgi to reflect your situation. Pay particular attention to the Perl interpreter location (first line) and the path to sendmail specified in $mailprog. If these variables are not set correctly, your script will not work.
  4. Create a link to or verify.cgi on a web page such as <a href="">. When the user selects that link, the form is built automatically.


Get the script file:

Copyright ©1998-1999 Duc M. Do. All rights reserved.
Web posted: 28 April 1998
last updated: 6 February 1999