1 <samba:parameter name="username map"
3 advanced="1" developer="1"
5 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
8 This option allows you to specify a file containing a mapping of usernames from the clients to the server.
9 This can be used for several purposes. The most common is to map usernames that users use on DOS or Windows
10 machines to those that the UNIX box uses. The other is to map multiple users to a single username so that they
11 can more easily share files.
15 Please note that for user or share mode security, the username map is applied prior to validating the user
16 credentials. Domain member servers (domain or ads) apply the username map after the user has been
17 successfully authenticated by the domain controller and require fully qualified enties in the map table (e.g.
18 biddle = <literal>DOMAIN\foo</literal>).
22 The map file is parsed line by line. Each line should contain a single UNIX username on the left then a '='
23 followed by a list of usernames on the right. The list of usernames on the right may contain names of the form
24 @group in which case they will match any UNIX username in that group. The special client name '*' is a
25 wildcard and matches any name. Each line of the map file may be up to 1023 characters long.
29 The file is processed on each line by taking the supplied username and comparing it with each username on the
30 right hand side of the '=' signs. If the supplied name matches any of the names on the right hand side then it
31 is replaced with the name on the left. Processing then continues with the next line.
35 If any line begins with a '#' or a ';' then it is ignored.
39 If any line begins with an '!' then the processing will stop after that line if a mapping was done by the
40 line. Otherwise mapping continues with every line being processed. Using '!' is most useful when you have a
41 wildcard mapping line later in the file.
45 For example to map from the name <constant>admin</constant> or <constant>administrator</constant> to the UNIX
46 name <constant> root</constant> you would use:
48 <command moreinfo="none">root = admin administrator</command>
50 Or to map anyone in the UNIX group <constant>system</constant> to the UNIX name <constant>sys</constant> you would use:
52 <command moreinfo="none">sys = @system</command>
57 You can have as many mappings as you like in a username map file.
62 If your system supports the NIS NETGROUP option then the netgroup database is checked before the <filename
63 moreinfo="none">/etc/group </filename> database for matching groups.
67 You can map Windows usernames that have spaces in them by using double quotes around the name. For example:
69 <command moreinfo="none">tridge = "Andrew Tridgell"</command>
71 would map the windows username "Andrew Tridgell" to the unix username "tridge".
75 The following example would map mary and fred to the unix user sys, and map the rest to guest. Note the use of the
76 '!' to tell Samba to stop processing if it gets a match on that line:
77 <programlisting format="linespecific">
84 Note that the remapping is applied to all occurrences of usernames. Thus if you connect to \\server\fred and
85 <constant>fred</constant> is remapped to <constant>mary</constant> then you will actually be connecting to
86 \\server\mary and will need to supply a password suitable for <constant>mary</constant> not
87 <constant>fred</constant>. The only exception to this is the username passed to the <smbconfoption
88 name="password server"/> (if you have one). The password server will receive whatever username the client
89 supplies without modification.
93 Also note that no reverse mapping is done. The main effect this has is with printing. Users who have been
94 mapped may have trouble deleting print jobs as PrintManager under WfWg will think they don't own the print
99 Samba versions prior to 3.0.8 would only support reading the fully qualified username
100 (e.g.: <literal>DOMAIN\user</literal>) from
101 the username map when performing a kerberos login from a client. However, when looking up a map entry for a
102 user authenticated by NTLM[SSP], only the login name would be used for matches. This resulted in inconsistent
103 behavior sometimes even on the same server.
107 The following functionality is obeyed in version 3.0.8 and later:
111 When performing local authentication, the username map is applied to the login name before attempting to authenticate
116 When relying upon a external domain controller for validating authentication requests, smbd will apply the username map
117 to the fully qualified username (i.e. <literal>DOMAIN\user</literal>) only after the user has been successfully authenticated.
121 An example of use is:
123 username map = /usr/local/samba/lib/users.map
129 <value type="default"><comment>no username map</comment></value>