DBMMANAGE(1)

πŸ“¦
version 2.4.69 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, nixpkgs unstable

πŸ’… DBMMANAGE(1) πŸ’…

okay bestie, so this page is from dbmmanage β€” the manual for that little Apache tool that handles your DBM-format password files ✨


🌸 NAME 🌸

dbmmanage β€” literally the tool that manages your user authentication files in DBM format 🫢


✨ SYNOPSIS ✨

dbmmanage [ encoding ] filename add|adduser|check|delete|update username
[ encpasswd [ group[,group...] [ comment ] ] ]

dbmmanage filename view [ username ]

dbmmanage filename import

πŸŽ€ SUMMARY πŸŽ€

So dbmmanage is the girlboss that creates and updates DBM format files β€” the ones that store usernames and passwords for basic authentication of HTTP users via mod_authn_dbm. Resources served by the Apache HTTP server can be locked down to just the users listed in the files this cutie makes πŸ”

Important vibe check though: this program can only be used when usernames are stored in a DBM file. If you're on a flat-file database situation, go see htpasswd instead, iykyk.

Another tool for maintaining a DBM password database is htdbm β€” good to know, bestie.

This manual page only lists the command line arguments, jsyk. For all the deets on the directives you need to configure user authentication in httpd, check the httpd manual β€” it comes with the Apache distribution or you can find it at http://httpd.apache.org/ 🌐


πŸ¦‹ OPTIONS πŸ¦‹

  • filename β€” the filename of the DBM format file, bestie. Usually without the .db, .pag, or .dir extension ✨
  • username β€” the user the operations are performed on. Fair warning: the username may not contain a colon (:).
  • encpasswd β€” this is the already hashed password used for the update and add commands. You can drop a hyphen (-) if you want to get prompted for the password but fill in the fields afterwards πŸ’… Also, when using the update command, a period (.) keeps the original password untouched.
  • group β€” a group that the user is a member of. Groupnames may not contain a colon (:). You can use a hyphen (-) if you don't want to assign the user to a group but still want to fill in the comment field. And when using the update command, a period (.) keeps the original groups untouched ✨
  • comment β€” the place for your totally opaque comments about the user, like realname, mailaddress, whatever. The server will ignore this field entirely, it's just for you πŸŽ€

πŸ’œ Encodings πŸ’œ

  • -d β€” crypt hashing (default, except on Win32, Netware)
  • -m β€” MD5 hashing (default on Win32, Netware)
  • -s β€” SHA1 hashing
  • -p β€” plaintext (not recommended, bestie, no cap 😭)

🌈 Commands 🌈

  • add β€” adds an entry for username to filename using the hashed password encpasswd. Like this:
dbmmanage passwords.dat add rbowen foKntnEF3KSXA
  • adduser β€” asks for a password and then adds an entry for username to filename. Obsessed with this flow fr:
dbmmanage passwords.dat adduser krietz
  • check β€” asks for a password and then checks if username is in filename and if its password matches the one you gave. Slay πŸ’…
dbmmanage passwords.dat check rbowen
  • delete β€” deletes the username entry from filename. Iconic and clean:
dbmmanage passwords.dat delete rbowen
  • import β€” reads username:password entries (one per line) from STDIN and adds them to filename. Heads up: the passwords already have to be crypted ✨
  • update β€” same as the adduser command, except it makes sure username already exists in filename. Gotta be there first, bestie:
dbmmanage passwords.dat update rbowen
  • view β€” just displays the contents of the DBM file. If you specify a username, it shows that particular record only πŸ‘€
dbmmanage passwords.dat view

πŸ’€ BUGS πŸ’€

Okay so this is the dramatic part, bestie β€” pay attention 😭

You should be aware that there are a number of different DBM file formats in existence, and with all likelihood, libraries for more than one format may exist on your system. The three primary examples are SDBM, NDBM, the GNU project's GDBM, and Berkeley DB 2. Unfortunately, all these libraries use different file formats, and you must make sure that the file format used by filename is the same format that dbmmanage expects to see 😬

dbmmanage currently has no way of determining what type of DBM file it's looking at. If used against the wrong format, it will simply return nothing, or may create a different DBM file with a different name, or β€” at worst β€” it may corrupt the DBM file if you were attempting to write to it. Literally be careful πŸ’€

dbmmanage has a list of DBM format preferences, defined by the @AnyDBM::ISA array near the beginning of the program. Since we prefer the Berkeley DB 2 file format, the order in which dbmmanage will look for system libraries is Berkeley DB 2, then NDBM, then GDBM and then SDBM. The first library found will be the library dbmmanage will attempt to use for all DBM file transactions 🫢

This ordering is slightly different than the standard @AnyDBM::ISA ordering in Perl, as well as the ordering used by the simple dbmopen() call in Perl β€” so if you use any other utilities to manage your DBM files, they must also follow this preference ordering. Similar care must be taken if using programs in other languages, like C, to access these files πŸ‘‘

One can usually use the file program supplied with most Unix systems to see what format a DBM file is in β€” a little detective work never hurt nobody πŸ”


and that's the whole page, bestie πŸŽ€ this manual page belongs to the Apache HTTP Server and is dated 2026-04-30 β€” go off and manage those DBM files responsibly, mwah πŸ’–βœ¨

πŸ“¦ where this page comes from