github.com/krum110487/go-htaccess@v0.0.0-20240316004156-60641c8e7598/tests/data/apache_2_2_34/manual/programs/htdbm.html.en (about) 1 <?xml version="1.0" encoding="ISO-8859-1"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head> 4 <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" /> 5 <!-- 6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 7 This file is generated from xml source: DO NOT EDIT 8 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 9 --> 10 <title>htdbm - Manipulate DBM password databases - Apache HTTP Server Version 2.2</title> 11 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> 12 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> 13 <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" /> 14 <script src="../style/scripts/prettify.min.js" type="text/javascript"> 15 </script> 16 17 <link href="../images/favicon.ico" rel="shortcut icon" /><link href="http://httpd.apache.org/docs/current/programs/htdbm.html" rel="canonical" /></head> 18 <body id="manual-page"><div id="page-header"> 19 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p> 20 <p class="apache">Apache HTTP Server Version 2.2</p> 21 <img alt="" src="../images/feather.gif" /></div> 22 <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> 23 <div id="path"> 24 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.2</a> > <a href="./">Programs</a></div><div id="page-content"><div class="retired"><h4>Please note</h4> 25 <p> This document refers to a legacy release (<strong>2.2</strong>) of Apache httpd. The active release (<strong>2.4</strong>) is documented <a href="http://httpd.apache.org/docs/current">here</a>. If you have not already upgraded, please follow <a href="http://httpd.apache.org/docs/current/upgrading.html">this link</a> for more information.</p> 26 <p>You may follow <a href="http://httpd.apache.org/docs/current/programs/htdbm.html">this link</a> to go to the current version of this document.</p></div><div id="preamble"><h1>htdbm - Manipulate DBM password databases</h1> 27 <div class="toplang"> 28 <p><span>Available Languages: </span><a href="../en/programs/htdbm.html" title="English"> en </a> | 29 <a href="../tr/programs/htdbm.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> 30 </div> 31 32 <p><code>htdbm</code> is used to manipulate the DBM format files used to 33 store usernames and password for basic authentication of HTTP users via 34 <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> 35 documentation for more information about these DBM files.</p> 36 </div> 37 <div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#synopsis">Synopsis</a></li> 38 <li><img alt="" src="../images/down.gif" /> <a href="#options">Options</a></li> 39 <li><img alt="" src="../images/down.gif" /> <a href="#bugs">Bugs</a></li> 40 <li><img alt="" src="../images/down.gif" /> <a href="#exit">Exit Status</a></li> 41 <li><img alt="" src="../images/down.gif" /> <a href="#examples">Examples</a></li> 42 <li><img alt="" src="../images/down.gif" /> <a href="#security">Security Considerations</a></li> 43 <li><img alt="" src="../images/down.gif" /> <a href="#restrictions">Restrictions</a></li> 44 </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><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> 45 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> 46 <div class="section"> 47 <h2><a name="synopsis" id="synopsis">Synopsis</a></h2> 48 <p><code><strong>htdbm</strong> 49 [ -<strong>T</strong><var>DBTYPE</var> ] 50 [ -<strong>c</strong> ] 51 [ -<strong>m</strong> | 52 -<strong>d</strong> | 53 -<strong>p</strong> | 54 -<strong>s</strong> ] 55 [ -<strong>t</strong> ] 56 [ -<strong>v</strong> ] 57 [ -<strong>x</strong> ] 58 <var>filename</var> <var>username</var></code></p> 59 60 <p><code><strong>htdbm</strong> -<strong>b</strong> 61 [ -<strong>T</strong><var>DBTYPE</var> ] 62 [ -<strong>c</strong> ] 63 [ -<strong>m</strong> | 64 -<strong>d</strong> | 65 -<strong>p</strong> | 66 -<strong>s</strong> ] 67 [ -<strong>t</strong> ] 68 [ -<strong>v</strong> ] 69 <var>filename</var> <var>username</var> <var>password</var></code></p> 70 71 <p><code><strong>htdbm</strong> -<strong>n</strong> 72 [ -<strong>c</strong> ] 73 [ -<strong>m</strong> | 74 -<strong>d</strong> | 75 -<strong>p</strong> | 76 -<strong>s</strong> ] 77 [ -<strong>t</strong> ] 78 [ -<strong>v</strong> ] 79 <var>username</var></code></p> 80 81 <p><code><strong>htdbm</strong> -<strong>nb</strong> 82 [ -<strong>c</strong> ] 83 [ -<strong>m</strong> | 84 -<strong>d</strong> | 85 -<strong>p</strong> | 86 -<strong>s</strong> ] 87 [ -<strong>t</strong> ] 88 [ -<strong>v</strong> ] 89 <var>username</var> <var>password</var></code></p> 90 91 <p><code><strong>htdbm</strong> -<strong>v</strong> 92 [ -<strong>T</strong><var>DBTYPE</var> ] 93 [ -<strong>c</strong> ] 94 [ -<strong>m</strong> | 95 -<strong>d</strong> | 96 -<strong>p</strong> | 97 -<strong>s</strong> ] 98 [ -<strong>t</strong> ] 99 [ -<strong>v</strong> ] 100 <var>filename</var> <var>username</var></code></p> 101 102 <p><code><strong>htdbm</strong> -<strong>vb</strong> 103 [ -<strong>T</strong><var>DBTYPE</var> ] 104 [ -<strong>c</strong> ] 105 [ -<strong>m</strong> | 106 -<strong>d</strong> | 107 -<strong>p</strong> | 108 -<strong>s</strong> ] 109 [ -<strong>t</strong> ] 110 [ -<strong>v</strong> ] 111 <var>filename</var> <var>username</var> <var>password</var></code></p> 112 113 <p><code><strong>htdbm</strong> -<strong>x</strong> 114 [ -<strong>T</strong><var>DBTYPE</var> ] 115 [ -<strong>m</strong> | 116 -<strong>d</strong> | 117 -<strong>p</strong> | 118 -<strong>s</strong> ] 119 <var>filename</var> <var>username</var></code></p> 120 121 <p><code><strong>htdbm</strong> -<strong>l</strong> 122 [ -<strong>T</strong><var>DBTYPE</var> ] 123 </code></p> 124 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> 125 <div class="section"> 126 <h2><a name="options" id="options">Options</a></h2> 127 <dl> 128 <dt><code>-b</code></dt> 129 <dd>Use batch mode; <em>i.e.</em>, get the password from the command line 130 rather than prompting for it. This option should be used with extreme care, 131 since <strong>the password is clearly visible</strong> on the command 132 line.</dd> 133 134 <dt><code>-c</code></dt> 135 <dd>Create the <var>passwdfile</var>. If <var>passwdfile</var> already 136 exists, it is rewritten and truncated. This option cannot be combined with 137 the <code>-n</code> option.</dd> 138 139 <dt><code>-n</code></dt> 140 <dd>Display the results on standard output rather than updating a 141 database. This option changes the syntax of the command line, since the 142 <var>passwdfile</var> argument (usually the first one) is omitted. It 143 cannot be combined with the <code>-c</code> option.</dd> 144 145 <dt><code>-m</code></dt> 146 <dd>Use MD5 encryption for passwords. On Windows, Netware and TPF, this is 147 the default.</dd> 148 149 <dt><code>-d</code></dt> 150 <dd>Use <code>crypt()</code> encryption for passwords. The default on all 151 platforms but Windows, Netware and TPF. Though possibly supported by 152 <code>htdbm</code> on all platforms, it is not supported by the 153 <code class="program"><a href="../programs/httpd.html">httpd</a></code> server on Windows, Netware and TPF.</dd> 154 155 <dt><code>-s</code></dt> 156 <dd>Use SHA encryption for passwords. Facilitates migration from/to Netscape 157 servers using the LDAP Directory Interchange Format (ldif).</dd> 158 159 <dt><code>-p</code></dt> 160 <dd>Use plaintext passwords. Though <code>htdbm</code> will support 161 creation on all platforms, the <code class="program"><a href="../programs/httpd.html">httpd</a></code> daemon will 162 only accept plain text passwords on Windows, Netware and TPF.</dd> 163 164 <dt><code>-l</code></dt> 165 <dd>Print each of the usernames and comments from the database on 166 stdout.</dd> 167 168 <dt><code>-t</code></dt> 169 <dd>Interpret the final parameter as a comment. When this option is 170 specified, an additional string can be appended to the command line; this 171 string will be stored in the "Comment" field of the database, associated 172 with the specified username.</dd> 173 174 <dt><code>-v</code></dt> 175 <dd>Verify the username and password. The program will print a message 176 indicating whether the supplied password is valid. If the password is 177 invalid, the program exits with error code 3.</dd> 178 179 <dt><code>-x</code></dt> 180 <dd>Delete user. If the username exists in the specified DBM file, it 181 will be deleted.</dd> 182 183 <dt><code><var>filename</var></code></dt> 184 <dd>The filename of the DBM format file. Usually without the extension 185 <code>.db</code>, <code>.pag</code>, or <code>.dir</code>. If 186 <code>-c</code> is given, the DBM file is created if it does not already 187 exist, or updated if it does exist.</dd> 188 189 <dt><code><var>username</var></code></dt> 190 <dd>The username to create or update in <var>passwdfile</var>. If 191 <var>username</var> does not exist in this file, an entry is added. If it 192 does exist, the password is changed.</dd> 193 194 <dt><code><var>password</var></code></dt> 195 <dd>The plaintext password to be encrypted and stored in the DBM file. 196 Used only with the <code>-b</code> flag.</dd> 197 198 <dt><code>-T<var>DBTYPE</var></code></dt> 199 <dd>Type of DBM file (SDBM, GDBM, DB, or "default").</dd> 200 </dl> 201 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> 202 <div class="section"> 203 <h2><a name="bugs" id="bugs">Bugs</a></h2> 204 <p>One should be aware that there are a number of different DBM file 205 formats in existence, and with all likelihood, libraries for more than 206 one format may exist on your system. The three primary examples are 207 SDBM, NDBM, GNU GDBM, and Berkeley/Sleepycat DB 2/3/4. Unfortunately, 208 all these libraries use different file formats, and you must make sure 209 that the file format used by <var>filename</var> is the same format that 210 <code>htdbm</code> expects to see. <code>htdbm</code> currently has 211 no way of determining what type of DBM file it is looking at. If used 212 against the wrong format, will simply return nothing, or may create a 213 different DBM file with a different name, or at worst, it may corrupt 214 the DBM file if you were attempting to write to it.</p> 215 216 <p>One can usually use the <code>file</code> program supplied with most 217 Unix systems to see what format a DBM file is in.</p> 218 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> 219 <div class="section"> 220 <h2><a name="exit" id="exit">Exit Status</a></h2> 221 <p><code>htdbm</code> returns a zero status ("true") if the username and 222 password have been successfully added or updated in the DBM File. 223 <code>htdbm</code> returns <code>1</code> if it encounters some problem 224 accessing files, <code>2</code> if there was a syntax problem with the 225 command line, <code>3</code> if the password was entered interactively and 226 the verification entry didn't match, <code>4</code> if its operation was 227 interrupted, <code>5</code> if a value is too long (username, filename, 228 password, or final computed record), <code>6</code> if the username 229 contains illegal characters (see the <a href="#restrictions">Restrictions 230 section</a>), and <code>7</code> if the file is not a valid DBM password 231 file.</p> 232 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> 233 <div class="section"> 234 <h2><a name="examples" id="examples">Examples</a></h2> 235 <div class="example"><p><code> 236 htdbm /usr/local/etc/apache/.htdbm-users jsmith 237 </code></p></div> 238 239 <p>Adds or modifies the password for user <code>jsmith</code>. The user 240 is prompted for the password. If executed on a Windows system, the password 241 will be encrypted using the modified Apache MD5 algorithm; otherwise, the 242 system's <code>crypt()</code> routine will be used. If the file does not 243 exist, <code>htdbm</code> will do nothing except return an error.</p> 244 245 <div class="example"><p><code> 246 htdbm -c /home/doe/public_html/.htdbm jane 247 </code></p></div> 248 249 <p>Creates a new file and stores a record in it for user <code>jane</code>. 250 The user is prompted for the password. If the file exists and cannot be 251 read, or cannot be written, it is not altered and <code>htdbm</code> 252 will display a message and return an error status.</p> 253 254 <div class="example"><p><code> 255 htdbm -mb /usr/web/.htdbm-all jones Pwd4Steve 256 </code></p></div> 257 258 <p>Encrypts the password from the command line (<code>Pwd4Steve</code>) 259 using the MD5 algorithm, and stores it in the specified file.</p> 260 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> 261 <div class="section"> 262 <h2><a name="security" id="security">Security Considerations</a></h2> 263 <p>Web password files such as those managed by <code>htdbm</code> should 264 <em>not</em> be within the Web server's URI space -- that is, they should 265 not be fetchable with a browser.</p> 266 267 <p>The use of the <code>-b</code> option is discouraged, since when it is 268 used the unencrypted password appears on the command line.</p> 269 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> 270 <div class="section"> 271 <h2><a name="restrictions" id="restrictions">Restrictions</a></h2> 272 <p>On the Windows and MPE platforms, passwords encrypted with 273 <code>htdbm</code> are limited to no more than <code>255</code> 274 characters in length. Longer passwords will be truncated to 255 275 characters.</p> 276 277 <p>The MD5 algorithm used by <code>htdbm</code> is specific to the Apache 278 software; passwords encrypted using it will not be usable with other Web 279 servers.</p> 280 281 <p>Usernames are limited to <code>255</code> bytes and may not include the 282 character <code>:</code>.</p> 283 </div></div> 284 <div class="bottomlang"> 285 <p><span>Available Languages: </span><a href="../en/programs/htdbm.html" title="English"> en </a> | 286 <a href="../tr/programs/htdbm.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p> 287 </div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> 288 <script type="text/javascript"><!--//--><![CDATA[//><!-- 289 var comments_shortname = 'httpd'; 290 var comments_identifier = 'http://httpd.apache.org/docs/2.2/programs/htdbm.html'; 291 (function(w, d) { 292 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 293 d.write('<div id="comments_thread"><\/div>'); 294 var s = d.createElement('script'); 295 s.type = 'text/javascript'; 296 s.async = true; 297 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 298 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 299 } 300 else { 301 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 302 } 303 })(window, document); 304 //--><!]]></script></div><div id="footer"> 305 <p class="apache">Copyright 2017 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> 306 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- 307 if (typeof(prettyPrint) !== 'undefined') { 308 prettyPrint(); 309 } 310 //--><!]]></script> 311 </body></html>