f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<?xml version="1.0" encoding="ISO-8859-1"?>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd<!--
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz This file is generated from xml source: DO NOT EDIT
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd -->
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc<title>mod_authn_file - Apache HTTP Server Version 2.5</title>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen<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" />
2e545ce2450a9953665f701bb05350f0d3f26275nd<script src="/style/scripts/prettify.min.js" type="text/javascript">
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen</script>
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<link href="/images/favicon.ico" rel="shortcut icon" /></head>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<body>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div id="page-header">
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/quickreference.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>
3f08db06526d6901aa08c110b5bc7dde6bc39905nd<p class="apache">Apache HTTP Server Version 2.5</p>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<img alt="" src="/images/feather.gif" /></div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div id="path">
3f08db06526d6901aa08c110b5bc7dde6bc39905nd<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="./">Modules</a></div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div id="page-content">
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div id="preamble"><h1>Apache Module mod_authn_file</h1>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<div class="toplang">
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd<p><span>Available Languages: </span><a href="/en/mod/mod_authn_file.html" title="English">&nbsp;en&nbsp;</a> |
0066eddda7203f6345b56f77d146a759298dc635gryzor<a href="/fr/mod/mod_authn_file.html" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a> |
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd<a href="/ja/mod/mod_authn_file.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung<a href="/ko/mod/mod_authn_file.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd</div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>User authentication using text files</td></tr>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>authn_file_module</td></tr>
b09fcdfc59ada4712150e7bcc7b502bb9e4601d8rjung<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_authn_file.c</td></tr></table>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<h3>Summary</h3>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <p>This module provides authentication front-ends such as
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <code class="module"><a href="/mod/mod_auth_digest.html">mod_auth_digest</a></code> and <code class="module"><a href="/mod/mod_auth_basic.html">mod_auth_basic</a></code>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz to authenticate users by looking up users in plain text password files.
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz Similar functionality is provided by <code class="module"><a href="/mod/mod_authn_dbm.html">mod_authn_dbm</a></code>.</p>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <p>When using <code class="module"><a href="/mod/mod_auth_basic.html">mod_auth_basic</a></code> or
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <code class="module"><a href="/mod/mod_auth_digest.html">mod_auth_digest</a></code>, this module is invoked via the
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <code class="directive"><a href="/mod/mod_auth_basic.html#authbasicprovider">AuthBasicProvider</a></code> or
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <code class="directive"><a href="/mod/mod_auth_digest.html#authdigestprovider">AuthDigestProvider</a></code>
aa0b2780958e9b1467c9d0153a05738e399811a5nd with the <code>file</code> value.</p>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd</div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div id="quickview"><h3 class="directives">Directives</h3>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<ul id="toc">
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<li><img alt="" src="/images/down.gif" /> <a href="#authuserfile">AuthUserFile</a></li>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd</ul>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<h3>See also</h3>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<ul class="seealso">
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<li>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <code class="directive"><a href="/mod/mod_auth_basic.html#authbasicprovider">AuthBasicProvider</a></code>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd</li>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<li>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <code class="directive"><a href="/mod/mod_auth_digest.html#authdigestprovider">AuthDigestProvider</a></code>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd</li>
9bcfc3697a91b5215893a7d0206865b13fc72148nd<li><code class="program"><a href="/programs/htpasswd.html">htpasswd</a></code></li>
9bcfc3697a91b5215893a7d0206865b13fc72148nd<li><code class="program"><a href="/programs/htdigest.html">htdigest</a></code></li>
f6066dc0a6ad0432b74774e290c04c3cc4aa2dafrbowen<li><a href="/misc/password_encryptions.html">Password Formats</a></li>
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div class="directive-section"><h2><a name="AuthUserFile" id="AuthUserFile">AuthUserFile</a> <a name="authuserfile" id="authuserfile">Directive</a></h2>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<table class="directive">
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the name of a text file containing the list of users and
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4ndpasswords for authentication</td></tr>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthUserFile <var>file-path</var></code></td></tr>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authn_file</td></tr>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd</table>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <p>The <code class="directive">AuthUserFile</code> directive sets the name
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz of a textual file containing the list of users and passwords for
aa0b2780958e9b1467c9d0153a05738e399811a5nd user authentication. <var>File-path</var> is the path to the user
aa0b2780958e9b1467c9d0153a05738e399811a5nd file. If it is not absolute, it is treated as relative to the
aa0b2780958e9b1467c9d0153a05738e399811a5nd <code class="directive"><a href="/mod/core.html#serverroot">ServerRoot</a></code>.</p>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <p>Each line of the user file contains a username followed by
aa0b2780958e9b1467c9d0153a05738e399811a5nd a colon, followed by the encrypted password. If the same user
aa0b2780958e9b1467c9d0153a05738e399811a5nd ID is defined multiple times, <code class="module"><a href="/mod/mod_authn_file.html">mod_authn_file</a></code> will
aa0b2780958e9b1467c9d0153a05738e399811a5nd use the first occurrence to verify the password.</p>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
f6066dc0a6ad0432b74774e290c04c3cc4aa2dafrbowen <p>The encrypted password format depends on which authentication
6b718fe57423ecb669c27dc0ac5e96b196ec8dbfhumbedooh frontend (e.g. <code class="module"><a href="/mod/mod_auth_basic.html">mod_auth_basic</a></code> or
6b718fe57423ecb669c27dc0ac5e96b196ec8dbfhumbedooh <code class="module"><a href="/mod/mod_auth_digest.html">mod_auth_digest</a></code>) is being used. See <a href="/misc/password_encryptions.html">Password Formats</a> for
f6066dc0a6ad0432b74774e290c04c3cc4aa2dafrbowen more information.</p>
f6066dc0a6ad0432b74774e290c04c3cc4aa2dafrbowen
6b718fe57423ecb669c27dc0ac5e96b196ec8dbfhumbedooh <p>For <code class="module"><a href="/mod/mod_auth_basic.html">mod_auth_basic</a></code>, use the utility <code class="program"><a href="/programs/htpasswd.html">htpasswd</a></code>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz which is installed as part of the binary distribution, or which
f6066dc0a6ad0432b74774e290c04c3cc4aa2dafrbowen can be found in <code>src/support</code>. See the
aa0b2780958e9b1467c9d0153a05738e399811a5nd <a href="/programs/htpasswd.html">man page</a> for more details.
aa0b2780958e9b1467c9d0153a05738e399811a5nd In short:</p>
aa0b2780958e9b1467c9d0153a05738e399811a5nd
aa0b2780958e9b1467c9d0153a05738e399811a5nd <p>Create a password file <code>Filename</code> with
aa0b2780958e9b1467c9d0153a05738e399811a5nd <code>username</code> as the initial ID. It will prompt for
aa0b2780958e9b1467c9d0153a05738e399811a5nd the password:</p>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
aa0b2780958e9b1467c9d0153a05738e399811a5nd <div class="example"><p><code>
aa0b2780958e9b1467c9d0153a05738e399811a5nd htpasswd -c Filename username
aa0b2780958e9b1467c9d0153a05738e399811a5nd </code></p></div>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
aa0b2780958e9b1467c9d0153a05738e399811a5nd <p>Add or modify <code>username2</code> in the password file
aa0b2780958e9b1467c9d0153a05738e399811a5nd <code>Filename</code>:</p>
aa0b2780958e9b1467c9d0153a05738e399811a5nd
aa0b2780958e9b1467c9d0153a05738e399811a5nd <div class="example"><p><code>
aa0b2780958e9b1467c9d0153a05738e399811a5nd htpasswd Filename username2
aa0b2780958e9b1467c9d0153a05738e399811a5nd </code></p></div>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz <p>Note that searching large text files is <em>very</em>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz inefficient; <code class="directive"><a href="/mod/mod_authn_dbm.html#authdbmuserfile">AuthDBMUserFile</a></code> should be used
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz instead.</p>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz
f320d19114066f93e78eb6218d5cf043796922f2humbedooh <p>For <code class="module"><a href="/mod/mod_auth_digest.html">mod_auth_digest</a></code>, use <code class="program"><a href="/programs/htdigest.html">htdigest</a></code>
aa0b2780958e9b1467c9d0153a05738e399811a5nd instead. Note that you cannot mix user data for Digest Authentication
aa0b2780958e9b1467c9d0153a05738e399811a5nd and Basic Authentication within the same file.</p>
aa0b2780958e9b1467c9d0153a05738e399811a5nd
aa0b2780958e9b1467c9d0153a05738e399811a5nd <div class="warning"><h3>Security</h3>
aa0b2780958e9b1467c9d0153a05738e399811a5nd <p>Make sure that the <code class="directive">AuthUserFile</code> is
aa0b2780958e9b1467c9d0153a05738e399811a5nd stored outside the document tree of the web-server. Do
aa0b2780958e9b1467c9d0153a05738e399811a5nd <strong>not</strong> put it in the directory that it protects.
aa0b2780958e9b1467c9d0153a05738e399811a5nd Otherwise, clients may be able to download the
aa0b2780958e9b1467c9d0153a05738e399811a5nd <code class="directive">AuthUserFile</code>.</p>
f43ed9051a7f4db461d67ed4f7ece175b3dbca7cjerenkrantz </div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd</div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd</div>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<div class="bottomlang">
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd<p><span>Available Languages: </span><a href="/en/mod/mod_authn_file.html" title="English">&nbsp;en&nbsp;</a> |
0066eddda7203f6345b56f77d146a759298dc635gryzor<a href="/fr/mod/mod_authn_file.html" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a> |
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd<a href="/ja/mod/mod_authn_file.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung<a href="/ko/mod/mod_authn_file.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
727872d18412fc021f03969b8641810d8896820bhumbedooh</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&amp;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>
0d0ba3a410038e179b695446bb149cce6264e0abnd<script type="text/javascript"><!--//--><![CDATA[//><!--
727872d18412fc021f03969b8641810d8896820bhumbedoohvar comments_shortname = 'httpd';
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedoohvar comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_authn_file.html';
0d0ba3a410038e179b695446bb149cce6264e0abnd(function(w, d) {
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
727872d18412fc021f03969b8641810d8896820bhumbedooh d.write('<div id="comments_thread"><\/div>');
0d0ba3a410038e179b695446bb149cce6264e0abnd var s = d.createElement('script');
0d0ba3a410038e179b695446bb149cce6264e0abnd s.type = 'text/javascript';
0d0ba3a410038e179b695446bb149cce6264e0abnd s.async = true;
ac082aefa89416cbdc9a1836eaf3bed9698201c8humbedooh s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
0d0ba3a410038e179b695446bb149cce6264e0abnd (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
0d0ba3a410038e179b695446bb149cce6264e0abnd }
0d0ba3a410038e179b695446bb149cce6264e0abnd else {
727872d18412fc021f03969b8641810d8896820bhumbedooh d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
0d0ba3a410038e179b695446bb149cce6264e0abnd }
0d0ba3a410038e179b695446bb149cce6264e0abnd})(window, document);
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh//--><!]]></script></div><div id="footer">
205f749042ed530040a4f0080dbcb47ceae8a374rjung<p class="apache">Copyright 2015 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>
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/quickreference.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[//><!--
0d0ba3a410038e179b695446bb149cce6264e0abndif (typeof(prettyPrint) !== 'undefined') {
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd prettyPrint();
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd}
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd//--><!]]></script>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd</body></html>