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