4

I got here a quite huge HTPASSWD file which stores the users and their encrypted passwords. This file is used to authenticate users using HTTP.

I got more than 2000 entries (users) in this file. The size of that file is 116KB.

screenshot of the htpasswd file via putty

Additionnaly, about 40 new entries are added in this file each day.

So I would like to know if I got a problem with an htpasswd file that big. And what are my alternatives to the htpasswd file? And how can I transfer my users and their encrypted passwords to the new alternative?

SOLUTION

I figured out how to convert my htpasswd file to the DBM format using this perl script: htpasswd2dbm.pl

Here is how to use it:

htpasswd2dbm.pl -htpasswd users usersdbm
Jonathan Rioux
  • 1,067
  • 2
  • 14
  • 30

1 Answers1

4

There is perfomance issues related to large htpasswd files. However you can use DBM format to improve performance for large password files:

http://httpd.apache.org/docs/2.0/mod/mod_auth_dbm.html#authdbmuserfile

A quick google provided this page which gives a good overview of using DBM files:

http://www.apacheweek.com/features/dbmauth

Drav Sloan
  • 1,562
  • 9
  • 13
  • What do I do with my current users and their encrypted passwords? How can I transfer these to the DBM format? I CANNOT retrieve their password in clear. – Jonathan Rioux Jul 06 '11 at 02:07
  • 2
    That is covered towards the bottom of the apacheweek link, you can use perl (or similar) to create the dbm file _from_ the htpasswd file. The DBM file uses a key/value pairs, where the value would be the "hashed" password for that users. The example script given is: http://www.apacheweek.com/issues/htpasswd2dbm.pl – Drav Sloan Jul 06 '11 at 02:16
  • Thanks Drav, I figured it out. – Jonathan Rioux Jul 06 '11 at 02:18
  • No problem! A vote on my answer would be appreciated :) thanks! – Drav Sloan Jul 06 '11 at 02:41