Re: What to do with the htpasswd program?

Doug MacEachern (
Thu, 29 Aug 1996 08:23:12 -0400 (EDT)

Date: Thu, 29 Aug 1996 08:23:12 -0400 (EDT)
From: Doug MacEachern <>
Subject: Re: What to do with the htpasswd program?
To: Michael Smith <>
In-Reply-To: <>
Message-Id: <>

On Thu, 29 Aug 1996, Michael Smith wrote:

> > Actually, invoking a shell like this probably isn't the best way to
> > accomplish this task.  I suggest calling the perl function crypt() to > create your own encrypted passwords and then appending the new "user" > string to an flocked existing .htpasswd file. This seems like it would > work with fcgi.
> I guess it would work, but what I wanted to achieve is a bit more
> complicated; namely I also want to be able to change existing passwords
> too.  I accept that the method you described could be made to work here
> too, but it's easier if I can get away with using existing tried &
> tested code.  Is this possible?

Yes, check out:

Looks like so:

my $admin = new HTTPD::UserAdmin 
    DB     => 'database_name',
    DBType => 'DBM';

$admin->add($username, $password);
$admin->update($username, $new_password);

You don't need to worry about things like crypt, salt, seeds, dbm, sql, md5
hashes, etc., it's all taken care of for you underneath.


> Mike