htdbm.html.en revision 7fec19672a491661b2fe4b29f685bc7f4efa64d4
5d52a1fe1b8ea396fb5ae7f6f1567c8383445113Tinderbox User<?xml version="1.0" encoding="ISO-8859-1"?>
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews This file is generated from xml source: DO NOT EDIT
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater -->
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence<title>htdbm - Manipulate DBM password databases - Apache HTTP Server</title>
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" />
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff<script src="/style/scripts/prettify.js" type="text/javascript">
e13d04fda918c0c14c2247475bb99e0760d9a6a4Evan Hunt</script>
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff
b81306ccd14066cb7378f7f74bbf3843b5a88985Michael Graff<link href="/images/favicon.ico" rel="shortcut icon" /></head>
b81306ccd14066cb7378f7f74bbf3843b5a88985Michael Graff<body id="manual-page"><div id="page-header">
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
62f07c300307f352e175ab680a92097720b30dfeMichael Graff<p class="apache">Apache HTTP Server Version 2.5</p>
34729dbcb3526974cf98ee03ec20a107d9458417Andreas Gustafsson<img alt="" src="/images/feather.gif" /></div>
34729dbcb3526974cf98ee03ec20a107d9458417Andreas Gustafsson<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff<div id="path">
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a> &gt; <a href="./">Programs</a></div><div id="page-content"><div id="preamble"><h1>htdbm - Manipulate DBM password databases</h1>
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff<div class="toplang">
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff<p><span>Available Languages: </span><a href="/en/programs/htdbm.html" title="English">&nbsp;en&nbsp;</a> |
70be3889746884692aa49939833d624ddd432bf0Mark Andrews<a href="/tr/programs/htdbm.html" hreflang="tr" rel="alternate" title="T�rk�e">&nbsp;tr&nbsp;</a></p>
70be3889746884692aa49939833d624ddd432bf0Mark Andrews</div>
668728fed845b9db9c1423946df03d5fc69f4eeeBrian Wellington
32ddc0e486b25df1e93b5d738b7b571fb3036d99James Brister <p><code>htdbm</code> is used to manipulate the DBM format files used to
668728fed845b9db9c1423946df03d5fc69f4eeeBrian Wellington store usernames and password for basic authentication of HTTP users via
70be3889746884692aa49939833d624ddd432bf0Mark Andrews <code class="module"><a href="/mod/mod_authn_dbm.html">mod_authn_dbm</a></code>. See the <code class="program"><a href="/programs/dbmmanage.html">dbmmanage</a></code>
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff documentation for more information about these DBM files.</p>
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff</div>
70be3889746884692aa49939833d624ddd432bf0Mark Andrews<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#synopsis">Synopsis</a></li>
668728fed845b9db9c1423946df03d5fc69f4eeeBrian Wellington<li><img alt="" src="/images/down.gif" /> <a href="#options">Options</a></li>
d03ee55286b48fb01fdc28c121b1128487ff8fb5David Lawrence<li><img alt="" src="/images/down.gif" /> <a href="#bugs">Bugs</a></li>
668728fed845b9db9c1423946df03d5fc69f4eeeBrian Wellington<li><img alt="" src="/images/down.gif" /> <a href="#exit">Exit Status</a></li>
70be3889746884692aa49939833d624ddd432bf0Mark Andrews<li><img alt="" src="/images/down.gif" /> <a href="#examples">Examples</a></li>
62f07c300307f352e175ab680a92097720b30dfeMichael Graff<li><img alt="" src="/images/down.gif" /> <a href="#security">Security Considerations</a></li>
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff<li><img alt="" src="/images/down.gif" /> <a href="#restrictions">Restrictions</a></li>
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff</ul><h3>See also</h3><ul class="seealso"><li><code class="program"><a href="/programs/httpd.html">httpd</a></code></li><li><code class="program"><a href="/programs/dbmmanage.html">dbmmanage</a></code></li><li><code class="module"><a href="/mod/mod_authn_dbm.html">mod_authn_dbm</a></code></li></ul></div>
34729dbcb3526974cf98ee03ec20a107d9458417Andreas Gustafsson<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff<div class="section">
70be3889746884692aa49939833d624ddd432bf0Mark Andrews<h2><a name="synopsis" id="synopsis">Synopsis</a></h2>
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff <p><code><strong>htdbm</strong>
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff [ -<strong>T</strong><var>DBTYPE</var> ]
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff [ -<strong>c</strong> ]
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff [ -<strong>m</strong> |
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews -<strong>d</strong> |
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff -<strong>p</strong> |
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff -<strong>s</strong> ]
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff [ -<strong>t</strong> ]
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff [ -<strong>v</strong> ]
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff [ -<strong>x</strong> ]
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff <var>filename</var> <var>username</var></code></p>
193738b819e3c699f9edd18864a6810fcfcec855Andreas Gustafsson
b81306ccd14066cb7378f7f74bbf3843b5a88985Michael Graff <p><code><strong>htdbm</strong> -<strong>b</strong>
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff [ -<strong>T</strong><var>DBTYPE</var> ]
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff [ -<strong>c</strong> ]
b81306ccd14066cb7378f7f74bbf3843b5a88985Michael Graff [ -<strong>m</strong> |
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews -<strong>d</strong> |
9f7d51ee3290e2a064d71016a6bd555b47134a7cMark Andrews -<strong>p</strong> |
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff -<strong>s</strong> ]
b81306ccd14066cb7378f7f74bbf3843b5a88985Michael Graff [ -<strong>t</strong> ]
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff [ -<strong>v</strong> ]
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff <var>filename</var> <var>username</var> <var>password</var></code></p>
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff <p><code><strong>htdbm</strong> -<strong>n</strong>
0d24df5c0b2f9546f403113df8ac4457223bc92fEvan Hunt [ -<strong>c</strong> ]
0d24df5c0b2f9546f403113df8ac4457223bc92fEvan Hunt [ -<strong>m</strong> |
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff -<strong>d</strong> |
922e6a3c2ac4ef900dd9dc99f0cc137f18372583Andreas Gustafsson -<strong>p</strong> |
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff -<strong>s</strong> ]
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff [ -<strong>t</strong> ]
f687e639f00a31e0884fb2c95a627b10b50c364bEvan Hunt [ -<strong>v</strong> ]
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff <var>username</var></code></p>
8a5809527e6c85e39699901712a455d5480907c1Evan Hunt
8a5809527e6c85e39699901712a455d5480907c1Evan Hunt <p><code><strong>htdbm</strong> -<strong>nb</strong>
8a5809527e6c85e39699901712a455d5480907c1Evan Hunt [ -<strong>c</strong> ]
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff [ -<strong>m</strong> |
818a7a5d462cb2cffabaf112890e6bb4fbb9cabdMichael Graff -<strong>d</strong> |
-<strong>p</strong> |
-<strong>s</strong> ]
[ -<strong>t</strong> ]
[ -<strong>v</strong> ]
<var>username</var> <var>password</var></code></p>
<p><code><strong>htdbm</strong> -<strong>v</strong>
[ -<strong>T</strong><var>DBTYPE</var> ]
[ -<strong>c</strong> ]
[ -<strong>m</strong> |
-<strong>d</strong> |
-<strong>p</strong> |
-<strong>s</strong> ]
[ -<strong>t</strong> ]
[ -<strong>v</strong> ]
<var>filename</var> <var>username</var></code></p>
<p><code><strong>htdbm</strong> -<strong>vb</strong>
[ -<strong>T</strong><var>DBTYPE</var> ]
[ -<strong>c</strong> ]
[ -<strong>m</strong> |
-<strong>d</strong> |
-<strong>p</strong> |
-<strong>s</strong> ]
[ -<strong>t</strong> ]
[ -<strong>v</strong> ]
<var>filename</var> <var>username</var> <var>password</var></code></p>
<p><code><strong>htdbm</strong> -<strong>x</strong>
[ -<strong>T</strong><var>DBTYPE</var> ]
[ -<strong>m</strong> |
-<strong>d</strong> |
-<strong>p</strong> |
-<strong>s</strong> ]
<var>filename</var> <var>username</var></code></p>
<p><code><strong>htdbm</strong> -<strong>l</strong>
[ -<strong>T</strong><var>DBTYPE</var> ]
</code></p>
</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="section">
<h2><a name="options" id="options">Options</a></h2>
<dl>
<dt><code>-b</code></dt>
<dd>Use batch mode; <em>i.e.</em>, get the password from the command line
rather than prompting for it. This option should be used with extreme care,
since <strong>the password is clearly visible</strong> on the command
line.</dd>
<dt><code>-c</code></dt>
<dd>Create the <var>passwdfile</var>. If <var>passwdfile</var> already
exists, it is rewritten and truncated. This option cannot be combined with
the <code>-n</code> option.</dd>
<dt><code>-n</code></dt>
<dd>Display the results on standard output rather than updating a
database. This option changes the syntax of the command line, since the
<var>passwdfile</var> argument (usually the first one) is omitted. It
cannot be combined with the <code>-c</code> option.</dd>
<dt><code>-m</code></dt>
<dd>Use MD5 encryption for passwords. On Windows and Netware, this is
the default.</dd>
<dt><code>-d</code></dt>
<dd>Use <code>crypt()</code> encryption for passwords. The default on all
platforms but Windows and Netware. Though possibly supported by
<code>htdbm</code> on all platforms, it is not supported by the
<code class="program"><a href="/programs/httpd.html">httpd</a></code> server on Windows and Netware.</dd>
<dt><code>-s</code></dt>
<dd>Use SHA encryption for passwords. Facilitates migration from/to Netscape
servers using the LDAP Directory Interchange Format (ldif).</dd>
<dt><code>-p</code></dt>
<dd>Use plaintext passwords. Though <code>htdbm</code> will support
creation on all platforms, the <code class="program"><a href="/programs/httpd.html">httpd</a></code> daemon will
only accept plain text passwords on Windows and Netware.</dd>
<dt><code>-l</code></dt>
<dd>Print each of the usernames and comments from the database on
stdout.</dd>
<dt><code>-t</code></dt>
<dd>Interpret the final parameter as a comment. When this option is
specified, an additional string can be appended to the command line; this
string will be stored in the "Comment" field of the database, associated
with the specified username.</dd>
<dt><code>-v</code></dt>
<dd>Verify the username and password. The program will print a message
indicating whether the supplied password is valid. If the password is
invalid, the program exits with error code 3.</dd>
<dt><code>-x</code></dt>
<dd>Delete user. If the username exists in the specified DBM file, it
will be deleted.</dd>
<dt><code><var>filename</var></code></dt>
<dd>The filename of the DBM format file. Usually without the extension
<code>.db</code>, <code>.pag</code>, or <code>.dir</code>. If
<code>-c</code> is given, the DBM file is created if it does not already
exist, or updated if it does exist.</dd>
<dt><code><var>username</var></code></dt>
<dd>The username to create or update in <var>passwdfile</var>. If
<var>username</var> does not exist in this file, an entry is added. If it
does exist, the password is changed.</dd>
<dt><code><var>password</var></code></dt>
<dd>The plaintext password to be encrypted and stored in the DBM file.
Used only with the <code>-b</code> flag.</dd>
<dt><code>-T<var>DBTYPE</var></code></dt>
<dd>Type of DBM file (SDBM, GDBM, DB, or "default").</dd>
</dl>
</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="section">
<h2><a name="bugs" id="bugs">Bugs</a></h2>
<p>One 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, GNU GDBM, and Berkeley/Sleepycat DB 2/3/4. Unfortunately,
all these libraries use different file formats, and you must make sure
that the file format used by <var>filename</var> is the same format that
<code>htdbm</code> expects to see. <code>htdbm</code> currently has
no way of determining what type of DBM file it is looking at. If used
against the wrong format, 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.</p>
<p>One can usually use the <code>file</code> program supplied with most
Unix systems to see what format a DBM file is in.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="section">
<h2><a name="exit" id="exit">Exit Status</a></h2>
<p><code>htdbm</code> returns a zero status ("true") if the username and
password have been successfully added or updated in the DBM File.
<code>htdbm</code> returns <code>1</code> if it encounters some problem
accessing files, <code>2</code> if there was a syntax problem with the
command line, <code>3</code> if the password was entered interactively and
the verification entry didn't match, <code>4</code> if its operation was
interrupted, <code>5</code> if a value is too long (username, filename,
password, or final computed record), <code>6</code> if the username
contains illegal characters (see the <a href="#restrictions">Restrictions
section</a>), and <code>7</code> if the file is not a valid DBM password
file.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="section">
<h2><a name="examples" id="examples">Examples</a></h2>
<div class="example"><p><code>
htdbm /usr/local/etc/apache/.htdbm-users jsmith
</code></p></div>
<p>Adds or modifies the password for user <code>jsmith</code>. The user
is prompted for the password. If executed on a Windows system, the password
will be encrypted using the modified Apache MD5 algorithm; otherwise, the
system's <code>crypt()</code> routine will be used. If the file does not
exist, <code>htdbm</code> will do nothing except return an error.</p>
<div class="example"><p><code>
htdbm -c /home/doe/public_html/.htdbm jane
</code></p></div>
<p>Creates a new file and stores a record in it for user <code>jane</code>.
The user is prompted for the password. If the file exists and cannot be
read, or cannot be written, it is not altered and <code>htdbm</code>
will display a message and return an error status.</p>
<div class="example"><p><code>
htdbm -mb /usr/web/.htdbm-all jones Pwd4Steve
</code></p></div>
<p>Encrypts the password from the command line (<code>Pwd4Steve</code>)
using the MD5 algorithm, and stores it in the specified file.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="section">
<h2><a name="security" id="security">Security Considerations</a></h2>
<p>Web password files such as those managed by <code>htdbm</code> should
<em>not</em> be within the Web server's URI space -- that is, they should
not be fetchable with a browser.</p>
<p>The use of the <code>-b</code> option is discouraged, since when it is
used the unencrypted password appears on the command line.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="section">
<h2><a name="restrictions" id="restrictions">Restrictions</a></h2>
<p>On the Windows platform, passwords encrypted with
<code>htdbm</code> are limited to no more than <code>255</code>
characters in length. Longer passwords will be truncated to 255
characters.</p>
<p>The MD5 algorithm used by <code>htdbm</code> is specific to the Apache
software; passwords encrypted using it will not be usable with other Web
servers.</p>
<p>Usernames are limited to <code>255</code> bytes and may not include the
character <code>:</code>.</p>
</div></div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="/en/programs/htdbm.html" title="English">&nbsp;en&nbsp;</a> |
<a href="/tr/programs/htdbm.html" hreflang="tr" rel="alternate" title="T�rk�e">&nbsp;tr&nbsp;</a></p>
</div><div id="footer">
<p class="apache">Copyright 2012 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
if (typeof(prettyPrint) !== undefined) {
prettyPrint();
}
//--><!]]></script>
</body></html>