1 <samba:parameter name="username map"
3 advanced="1" developer="1"
4 xmlns:samba="http://samba.org/common">
6 <para>This option allows you to specify a file containing
7 a mapping of usernames from the clients to the server. This can be
8 used for several purposes. The most common is to map usernames
9 that users use on DOS or Windows machines to those that the UNIX
10 box uses. The other is to map multiple users to a single username
11 so that they can more easily share files.</para>
13 <para>The map file is parsed line by line. Each line should
14 contain a single UNIX username on the left then a '=' followed
15 by a list of usernames on the right. The list of usernames on the
16 right may contain names of the form @group in which case they
17 will match any UNIX username in that group. The special client
18 name '*' is a wildcard and matches any name. Each line of the
19 map file may be up to 1023 characters long.</para>
21 <para>The file is processed on each line by taking the
22 supplied username and comparing it with each username on the right
23 hand side of the '=' signs. If the supplied name matches any of
24 the names on the right hand side then it is replaced with the name
25 on the left. Processing then continues with the next line.</para>
27 <para>If any line begins with a '#' or a ';' then it is ignored</para>
29 <para>If any line begins with an '!' then the processing
30 will stop after that line if a mapping was done by the line.
31 Otherwise mapping continues with every line being processed.
32 Using '!' is most useful when you have a wildcard mapping line
33 later in the file.</para>
35 <para>For example to map from the name <constant>admin</constant>
36 or <constant>administrator</constant> to the UNIX name <constant>
37 root</constant> you would use:</para>
39 <para><command moreinfo="none">root = admin administrator</command></para>
41 <para>Or to map anyone in the UNIX group <constant>system</constant>
42 to the UNIX name <constant>sys</constant> you would use:</para>
44 <para><command moreinfo="none">sys = @system</command></para>
46 <para>You can have as many mappings as you like in a username map file.</para>
49 <para>If your system supports the NIS NETGROUP option then
50 the netgroup database is checked before the <filename moreinfo="none">/etc/group
51 </filename> database for matching groups.</para>
53 <para>You can map Windows usernames that have spaces in them
54 by using double quotes around the name. For example:</para>
56 <para><command moreinfo="none">tridge = "Andrew Tridgell"</command></para>
58 <para>would map the windows username "Andrew Tridgell" to the
59 unix username "tridge".</para>
61 <para>The following example would map mary and fred to the
62 unix user sys, and map the rest to guest. Note the use of the
63 '!' to tell Samba to stop processing if it gets a match on
66 <para><programlisting format="linespecific">
69 </programlisting></para>
71 <para>Note that the remapping is applied to all occurrences
72 of usernames. Thus if you connect to \\server\fred and <constant>
73 fred</constant> is remapped to <constant>mary</constant> then you
74 will actually be connecting to \\server\mary and will need to
75 supply a password suitable for <constant>mary</constant> not
76 <constant>fred</constant>. The only exception to this is the
77 username passed to the <link linkend="PASSWORDSERVER"><parameter moreinfo="none">
78 password server</parameter></link> (if you have one). The password
79 server will receive whatever username the client supplies without
82 <para>Also note that no reverse mapping is done. The main effect
83 this has is with printing. Users who have been mapped may have
84 trouble deleting print jobs as PrintManager under WfWg will think
85 they don't own the print job.</para>
87 <para>Default: <emphasis>no username map</emphasis></para>
89 <para>Example: <command moreinfo="none">username map = /usr/local/samba/lib/users.map</command></para>