This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.
[samba.git] / docs / docbook / smbdotconf / security / usernamemap.xml
1 <samba:parameter name="username map"
2                  context="G"
3                  advanced="1" developer="1"
4                  xmlns:samba="http://samba.org/common">
5 <listitem>
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>
12     
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>
20
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>
26
27     <para>If any line begins with a '#' or a ';' then it is ignored</para>
28
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>
34
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>
38
39     <para><command moreinfo="none">root = admin administrator</command></para>
40
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>
43
44     <para><command moreinfo="none">sys = @system</command></para>
45
46     <para>You can have as many mappings as you like in a username map file.</para>
47
48
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>
52
53     <para>You can map Windows usernames that have spaces in them
54      by using double quotes around the name. For example:</para>
55
56     <para><command moreinfo="none">tridge = &quot;Andrew Tridgell&quot;</command></para>
57
58     <para>would map the windows username &quot;Andrew Tridgell&quot; to the
59     unix username &quot;tridge&quot;.</para>
60
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
64     that line.</para>
65
66 <para><programlisting format="linespecific">
67 !sys = mary fred
68 guest = *
69 </programlisting></para>
70
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
80     modification.</para>
81
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>
86
87     <para>Default: <emphasis>no username map</emphasis></para>
88
89     <para>Example: <command moreinfo="none">username map = /usr/local/samba/lib/users.map</command></para>
90 </listitem>
91 </samba:parameter>