Search code examples
performanceauthenticationdebian.htpasswddbm

Linux - HTPASSWD file too big? (more than 2000 users)


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

Solution

  • 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