docs:smbdotconf: make formatting of headers uniform.
[samba.git] / docs-xml / smbdotconf / security / usernamemap.xml
1 <samba:parameter name="username map"
2                  context="G"
3                  type="string"
4                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
5 <description>
6     <para>
7         This option allows you to specify a file containing a mapping of usernames from the clients to the server.
8         This can be used for several purposes. The most common is to map usernames that users use on DOS or Windows
9         machines to those that the UNIX box uses. The other is to map multiple users to a single username so that they
10         can more easily share files.
11         </para>
12
13     <para>
14         Please note that for user mode security, the username map is applied prior to validating the user
15         credentials.  Domain member servers (domain or ads) apply the username map after the user has been
16         successfully authenticated by the domain controller and require fully qualified entries in the map table (e.g.
17         biddle = <literal>DOMAIN\foo</literal>).
18         </para>
19     
20     <para>
21         The map file is parsed line by line. Each line should contain a single UNIX username on the left then a '='
22         followed by a list of usernames on the right. The list of usernames on the right may contain names of the form
23         @group in which case they will match any UNIX username in that group. The special client name '*' is a
24         wildcard and matches any name. Each line of the map file may be up to 1023 characters long.
25         </para>
26
27     <para>
28         The file is processed on each line by taking the supplied username and comparing it with each username on the
29         right hand side of the '=' signs. If the supplied name matches any of the names on the right hand side then it
30         is replaced with the name on the left. Processing then continues with the next line.
31         </para>
32
33     <para>
34         If any line begins with a '#' or a ';' then it is ignored.
35         </para>
36
37     <para>
38         If any line begins with an '!' then the processing will stop after that line if a mapping was done by the
39         line.  Otherwise mapping continues with every line being processed.  Using '!' is most useful when you have a
40         wildcard mapping line later in the file.
41         </para>
42
43     <para>
44         For example to map from the name <constant>admin</constant> or <constant>administrator</constant> to the UNIX
45         name <constant> root</constant> you would use:
46 <programlisting>
47 <command moreinfo="none">root = admin administrator</command>
48 </programlisting>
49         Or to map anyone in the UNIX group <constant>system</constant> to the UNIX name <constant>sys</constant> you would use:
50 <programlisting>
51 <command moreinfo="none">sys = @system</command>
52 </programlisting>
53         </para>
54
55     <para>
56         You can have as many mappings as you like in a username map file.
57         </para>
58
59
60     <para>
61         If your system supports the NIS NETGROUP option then the netgroup database is checked before the <filename
62         moreinfo="none">/etc/group </filename> database for matching groups.
63         </para>
64
65     <para>
66         You can map Windows usernames that have spaces in them by using double quotes around the name. For example:
67 <programlisting>
68 <command moreinfo="none">tridge = &quot;Andrew Tridgell&quot;</command>
69 </programlisting>
70     would map the windows username &quot;Andrew Tridgell&quot; to the unix username &quot;tridge&quot;.
71         </para>
72
73     <para>
74         The following example would map mary and fred to the unix user sys, and map the rest to guest. Note the use of the
75     '!' to tell Samba to stop processing if it gets a match on that line:
76 <programlisting format="linespecific">
77 !sys = mary fred
78 guest = *
79 </programlisting>
80     </para>
81
82     <para>
83         Note that the remapping is applied to all occurrences of usernames.  Thus if you connect to \\server\fred and
84         <constant>fred</constant> is remapped to <constant>mary</constant> then you will actually be connecting to
85         \\server\mary and will need to supply a password suitable for <constant>mary</constant> not
86         <constant>fred</constant>. The only exception to this is the
87         username passed to a Domain Controller (if you have one). The DC will receive whatever username the client
88         supplies without  modification.
89     </para>
90
91     <para>
92         Also note that no reverse mapping is done. The main effect this has is with printing. Users who have been
93         mapped may have trouble deleting print jobs as PrintManager under WfWg will think they don't own the print
94         job.
95         </para>
96
97    <para>
98         Samba versions prior to 3.0.8 would only support reading the fully qualified username 
99         (e.g.: <literal>DOMAIN\user</literal>) from
100         the username map when performing a kerberos login from a client.  However, when looking up a map entry for a
101         user authenticated by NTLM[SSP], only the login name would be used for matches.  This resulted in inconsistent
102         behavior sometimes even on the same server.
103    </para>
104
105    <para>
106    The following functionality is obeyed in version 3.0.8 and later:
107    </para>
108
109    <para>
110     When performing local authentication, the username map is applied to the login name before attempting to authenticate
111     the connection.
112     </para>
113
114     <para>
115     When relying upon a external domain controller for validating authentication requests, smbd will apply the username map
116     to the fully qualified username (i.e. <literal>DOMAIN\user</literal>) only after the user has been successfully authenticated.
117     </para>
118
119     <para>
120     An example of use is:
121 <programlisting>
122 username map = /usr/local/samba/lib/users.map
123 </programlisting>
124     </para>
125
126 </description>
127
128 <value type="default"><comment>no username map</comment></value>
129 </samba:parameter>