1 <?xml version='1.0' encoding='UTF-8' ?>
2 <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <manualpage metafile="dbmmanage.xml.meta">
5 <parentdocument href="./">Programs</parentdocument>
7 <title>dbmmanage - Manage user authentication files in DBM format</title>
10 <p><code>dbmmanage</code> is used to create and update the DBM format files
11 used to store usernames and password for basic authentication of HTTP users.
12 Resources available from the Apache HTTP server can be restricted to just
13 the users listed in the files created by <code>dbmmanage</code>. This
14 program can only be used when the usernames are stored in a DBM file. To
15 use a flat-file database see <a href="htpasswd.html">htpasswd</a>.</p>
17 <p>This manual page only lists the command line arguments. For details of
18 the directives necessary to configure user authentication in
19 <a href="httpd.html">httpd</a> see the httpd manual, which is part of
20 the Apache distribution or can be found at <a
21 href="http://httpd.apache.org/">http://httpd.apache.org/</a>.</p>
23 <seealso><a href="httpd.html">httpd</a></seealso>
24 <seealso><module>mod_authn_dbm</module></seealso>
25 <seealso><module>mod_authz_dbm</module></seealso>
27 <section id="synopsis"><title>Synopsis</title>
28 <p><code><strong>dbmmanage</strong> [ <var>encoding</var> ]
29 <var>filename</var> add|adduser|check|delete|update
31 [ <var>encpasswd</var>
32 [ <var>group</var>[,<var>group</var>...]
33 [ <var>comment</var> ] ] ]</code></p>
35 <p><code><strong>dbmmanage</strong> <var>filename</var>
36 view [ <var>username</var> ]</code></p>
38 <p><code><strong>dbmmanage</strong> <var>filename</var> import</code></p>
41 <section id="options"><title>Options</title>
43 <dt><code><var>filename</var></code></dt>
44 <dd>The filename of the DBM format file. Usually without the extension
45 <code>.db</code>, <code>.pag</code>, or <code>.dir</code>.</dd>
47 <dt><code><var>username</var></code></dt>
48 <dd>The user for which the operations are performed. The <var>username</var>
49 may not contain a colon (<code>:</code>).</dd>
51 <dt><code><var>encpasswd</var></code></dt>
52 <dd>This is the already encrypted password to use for the
53 <code>update</code> and <code>add</code> commands. You may use a hyphen
54 (<code>-</code>) if you want to get prompted for the password, but fill
55 in the fields afterwards. Additionally when using the <code>update</code>
56 command, a period (<code>.</code>) keeps the original password
59 <dt><code><var>group</var></code></dt>
60 <dd>A group, which the user is member of. A groupname may not contain a
61 colon (<code>:</code>). You may use a hyphen (<code>-</code>) if you don't
62 want to assign the user to a group, but fill in the comment field.
63 Additionally when using the <code>update</code> command, a period
64 (<code>.</code>) keeps the original groups untouched.</dd>
66 <dt><code><var>comment</var></code></dt>
67 <dd>This is the place for your opaque comments about the user, like
68 realname, mailaddress or such things. The server will ignore this
72 <section id="options.encodings"><title>Encodings</title>
74 <dt><code>-d</code></dt>
75 <dd>crypt encryption (default, except on Win32, Netware)</dd>
77 <dt><code>-m</code></dt>
78 <dd>MD5 encryption (default on Win32, Netware)</dd>
80 <dt><code>-s</code></dt>
81 <dd>SHA1 encryption</dd>
83 <dt><code>-p</code></dt>
84 <dd>plaintext (<em>not recommended</em>)</dd>
88 <section id="options.commands"><title>Commands</title>
90 <dt><code>add</code></dt>
91 <dd>Adds an entry for <var>username</var> to <var>filename</var> using the
92 encrypted password <var>encpasswd</var>.</dd>
94 <dt><code>adduser</code></dt>
95 <dd>Asks for a password and then adds an entry for <var>username</var> to
96 <var>filename</var>.</dd>
98 <dt><code>check</code></dt>
99 <dd>Asks for a password and then checks if <var>username</var> is in
100 <var>filename</var> and if it's password matches the specified one.</dd>
102 <dt><code>delete</code></dt>
103 <dd>Deletes the <var>username</var> entry from <var>filename</var>.</dd>
105 <dt><code>import</code></dt>
106 <dd>Reads <code><var>username</var>:<var>password</var></code> entries
107 (one per line) from <code>STDIN</code> and adds them to
108 <var>filename</var>. The passwords already have to be crypted.</dd>
110 <dt><code>update</code></dt>
111 <dd>Same as the <code>adduser</code> command, except that it makes
112 sure <var>username</var> already exists in <var>filename</var>.</dd>
114 <dt><code>view</code></dt>
115 <dd>Just displays the contents of the DBM file. If you specify a
116 <var>username</var>, it displays the particular record only.</dd>
121 <section id="bugs"><title>Bugs</title>
122 <p>One should be aware that there are a number of different DBM file formats
123 in existence, and with all likelihood, libraries for more than one format
124 may exist on your system. The three primary examples are SDBM, NDBM, the GNU
125 project's GDBM, and Berkeley DB 2. Unfortunately, all these libraries use
126 different file formats, and you must make sure that the file format used
127 by <var>filename</var> is the same format that <code>dbmmanage</code>
128 expects to see. <code>dbmmanage</code> currently has no way of determining
129 what type of DBM file it is looking at. If used against the wrong format,
130 will simply return nothing, or may create a different DBM file with a
131 different name, or at worst, it may corrupt the DBM file if you were
132 attempting to write to it.</p>
134 <p><code>dbmmanage</code> has a list of DBM format preferences, defined by
135 the <code>@AnyDBM::ISA</code> array near the beginning of the program. Since
136 we prefer the Berkeley DB 2 file format, the order in which
137 <code>dbmmanage</code> will look for system libraries is Berkeley DB 2,
138 then NDBM, then GDBM and then SDBM. The first library found will be the
139 library <code>dbmmanage</code> will attempt to use for all DBM file
140 transactions. This ordering is slightly different than the standard
141 <code>@AnyDBM::ISA</code> ordering in perl, as well as the ordering used by
142 the simple <code>dbmopen()</code> call in Perl, so if you use any other
143 utilities to manage your DBM files, they must also follow this preference
144 ordering. Similar care must be taken if using programs in other languages,
145 like C, to access these files.</p>
147 <p>One can usually use the <code>file</code> program supplied with most
148 Unix systems to see what format a DBM file is in.</p>