]> granicus.if.org Git - apache/commitdiff
Give an example of converting a password file from one format to the
authorRich Bowen <rbowen@apache.org>
Mon, 4 Jul 2016 17:19:08 +0000 (17:19 +0000)
committerRich Bowen <rbowen@apache.org>
Mon, 4 Jul 2016 17:19:08 +0000 (17:19 +0000)
other.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1751351 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/programs/htdbm.html.en
docs/manual/programs/htdbm.xml

index 512a73e0c700eea76aeb86176357cc2db5c48a84..a19a374be2c82f6576df1d04a5abc9cde19da7eb 100644 (file)
 
     <p>Encrypts the password from the command line (<code>Pwd4Steve</code>)
     using the MD5 algorithm, and stores it in the specified file.</p>
+
+    <p>To convert an existing text file <code>htpasswd</code>-generated
+    password file to a <code>dbm</code> file, use <code>awk</code> to
+    feed each line of that file into <code>htdbm</code>:</p>
+
+    <div class="example"><p><code>
+      htdbm -cbp passwords.dbm bogus bogus
+      awk &#8216;BEGIN { FS=&#8221;:&#8221; }; {system (&#8220;htdbm -bp passwords.dbm &#8221; $1 &#8221; &#8221; $2)}&#8217; passwords
+      htdbm -x bogus
+    </code></p></div>
+
+    <p>The first line creates a new password database with a temporary
+    placeholder entry, and the thrid line removes that placeholder.</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>
index 38bbc0b9e616d24dd332518098be9592e80636b1..522431725e850caac7ea13989d531709b053a620 100644 (file)
 
     <p>Encrypts the password from the command line (<code>Pwd4Steve</code>)
     using the MD5 algorithm, and stores it in the specified file.</p>
+
+    <p>To convert an existing text file <code>htpasswd</code>-generated
+    password file to a <code>dbm</code> file, use <code>awk</code> to
+    feed each line of that file into <code>htdbm</code>:</p>
+
+    <example>
+      htdbm -cbp passwords.dbm bogus bogus
+      awk ‘BEGIN { FS=”:” }; {system (“htdbm -bp passwords.dbm ” $1 ” ” $2)}’ passwords
+      htdbm -x bogus
+    </example>
+
+    <p>The first line creates a new password database with a temporary
+    placeholder entry, and the thrid line removes that placeholder.</p>
+
 </section>
 
 <section id="security"><title>Security Considerations</title>