1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�12.�Group Mapping: MS Windows and UNIX</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.0"><link rel="start" href="index.html" title="The Official Samba-3 HOWTO and Reference Guide"><link rel="up" href="optional.html" title="Part�III.�Advanced Configuration"><link rel="prev" href="passdb.html" title="Chapter�11.�Account Information Databases"><link rel="next" href="NetCommand.html" title="Chapter�13.�Remote and Local Management: The Net Command"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter�12.�Group Mapping: MS Windows and UNIX</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="passdb.html">Prev</a>�</td><th width="60%" align="center">Part�III.�Advanced Configuration</th><td width="20%" align="right">�<a accesskey="n" href="NetCommand.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="groupmapping"></a>Chapter�12.�Group Mapping: MS Windows and UNIX</h2></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a href="mailto:jht@samba.org">jht@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jean Fran�ois</span> <span class="surname">Micouleau</span></h3></div></div><div><div class="author"><h3 class="author"><span class="firstname">Gerald</span> <span class="othername">(Jerry)</span> <span class="surname">Carter</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a href="mailto:jerry@samba.org">jerry@samba.org</a>></code></p></div></div></div></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="groupmapping.html#id359469">Features and Benefits</a></span></dt><dt><span class="sect1"><a href="groupmapping.html#id359854">Discussion</a></span></dt><dd><dl><dt><span class="sect2"><a href="groupmapping.html#id360168">Warning: User Private Group Problems</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id360220">Nested Groups: Adding Windows Domain Groups to Windows Local Groups</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id360749">Important Administrative Information</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id360970">Default Users, Groups, and Relative Identifiers</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id361575">Example Configuration</a></span></dt></dl></dd><dt><span class="sect1"><a href="groupmapping.html#id361647">Configuration Scripts</a></span></dt><dd><dl><dt><span class="sect2"><a href="groupmapping.html#id361657">Sample <code class="filename">smb.conf</code> Add Group Script</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id361818">Script to Configure Group Mapping</a></span></dt></dl></dd><dt><span class="sect1"><a href="groupmapping.html#id361932">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="groupmapping.html#id361943">Adding Groups Fails</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id362018">Adding Domain Users to the Workstation Power Users Group</a></span></dt></dl></dd></dl></div><p>
2
<a class="indexterm" name="id359351"></a>
3
<a class="indexterm" name="id359360"></a>
4
<a class="indexterm" name="id359367"></a>
5
<a class="indexterm" name="id359374"></a>
6
<a class="indexterm" name="id359380"></a>
7
<a class="indexterm" name="id359387"></a>
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�12.�Group Mapping: MS Windows and UNIX</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="The Official Samba 3.2.x HOWTO and Reference Guide"><link rel="up" href="optional.html" title="Part�III.�Advanced Configuration"><link rel="prev" href="passdb.html" title="Chapter�11.�Account Information Databases"><link rel="next" href="NetCommand.html" title="Chapter�13.�Remote and Local Management: The Net Command"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter�12.�Group Mapping: MS Windows and UNIX</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="passdb.html">Prev</a>�</td><th width="60%" align="center">Part�III.�Advanced Configuration</th><td width="20%" align="right">�<a accesskey="n" href="NetCommand.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="groupmapping"></a>Chapter�12.�Group Mapping: MS Windows and UNIX</h2></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jht@samba.org">jht@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jean Fran�ois</span> <span class="surname">Micouleau</span></h3></div></div><div><div class="author"><h3 class="author"><span class="firstname">Gerald</span> <span class="othername">(Jerry)</span> <span class="surname">Carter</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jerry@samba.org">jerry@samba.org</a>></code></p></div></div></div></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="groupmapping.html#id382442">Features and Benefits</a></span></dt><dt><span class="sect1"><a href="groupmapping.html#id382834">Discussion</a></span></dt><dd><dl><dt><span class="sect2"><a href="groupmapping.html#id383149">Warning: User Private Group Problems</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id383201">Nested Groups: Adding Windows Domain Groups to Windows Local Groups</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id383730">Important Administrative Information</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id383950">Default Users, Groups, and Relative Identifiers</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id384556">Example Configuration</a></span></dt></dl></dd><dt><span class="sect1"><a href="groupmapping.html#id384627">Configuration Scripts</a></span></dt><dd><dl><dt><span class="sect2"><a href="groupmapping.html#id384638">Sample <code class="filename">smb.conf</code> Add Group Script</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id384798">Script to Configure Group Mapping</a></span></dt></dl></dd><dt><span class="sect1"><a href="groupmapping.html#id384912">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="groupmapping.html#id384922">Adding Groups Fails</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id385002">Adding Domain Users to the Workstation Power Users Group</a></span></dt></dl></dd></dl></div><p>
2
<a class="indexterm" name="id382324"></a>
3
<a class="indexterm" name="id382333"></a>
4
<a class="indexterm" name="id382339"></a>
5
<a class="indexterm" name="id382346"></a>
6
<a class="indexterm" name="id382353"></a>
7
<a class="indexterm" name="id382360"></a>
8
8
Starting with Samba-3, new group mapping functionality is available to create associations
9
9
between Windows group SIDs and UNIX group GIDs. The <code class="literal">groupmap</code> subcommand
10
10
included with the <span class="application">net</span> tool can be used to manage these associations.
12
<a class="indexterm" name="id359410"></a>
13
<a class="indexterm" name="id359417"></a>
12
<a class="indexterm" name="id382383"></a>
13
<a class="indexterm" name="id382390"></a>
14
14
The new facility for mapping NT groups to UNIX system groups allows the administrator to decide
15
15
which NT domain groups are to be exposed to MS Windows clients. Only those NT groups that map
16
16
to a UNIX group that has a value other than the default (<code class="constant">-1</code>) will be exposed
17
17
in group selection lists in tools that access domain users and groups.
18
18
</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
19
<a class="indexterm" name="id359436"></a>
20
<a class="indexterm" name="id359443"></a>
19
<a class="indexterm" name="id382408"></a>
20
<a class="indexterm" name="id382415"></a>
21
21
The <em class="parameter"><code>domain admin group</code></em> parameter has been removed in Samba-3 and should no longer
22
22
be specified in <code class="filename">smb.conf</code>. In Samba-2.2.x, this parameter was used to give the listed users membership in the
23
23
<code class="constant">Domain Admins</code> Windows group, which gave local admin rights on their workstations
24
24
(in default configurations).
25
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id359469"></a>Features and Benefits</h2></div></div></div><p>
25
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id382442"></a>Features and Benefits</h2></div></div></div><p>
26
26
Samba allows the administrator to create MS Windows NT4/200x group accounts and to
27
27
arbitrarily associate them with UNIX/Linux group accounts.
29
<a class="indexterm" name="id359482"></a>
30
<a class="indexterm" name="id359488"></a>
31
<a class="indexterm" name="id359495"></a>
32
<a class="indexterm" name="id359501"></a>
33
<a class="indexterm" name="id359508"></a>
34
<a class="indexterm" name="id359515"></a>
35
<a class="indexterm" name="id359522"></a>
29
<a class="indexterm" name="id382454"></a>
30
<a class="indexterm" name="id382460"></a>
31
<a class="indexterm" name="id382467"></a>
32
<a class="indexterm" name="id382474"></a>
33
<a class="indexterm" name="id382480"></a>
34
<a class="indexterm" name="id382487"></a>
35
<a class="indexterm" name="id382494"></a>
36
36
Group accounts can be managed using the MS Windows NT4 or MS Windows 200x/XP Professional MMC tools.
37
37
Appropriate interface scripts should be provided in <code class="filename">smb.conf</code> if it is desired that UNIX/Linux system
38
38
accounts should be automatically created when these tools are used. In the absence of these scripts, and
39
39
so long as <code class="literal">winbindd</code> is running, Samba group accounts that are created using these
40
40
tools will be allocated UNIX UIDs and GIDs from the ID range specified by the
41
<a class="indexterm" name="id359544"></a>idmap uid/<a class="indexterm" name="id359551"></a>idmap gid
41
<a class="link" href="smb.conf.5.html#IDMAPUID">idmap uid</a>/<a class="link" href="smb.conf.5.html#IDMAPGID">idmap gid</a>
42
42
parameters in the <code class="filename">smb.conf</code> file.
43
43
</p><div class="figure"><a name="idmap-sid2gid"></a><p class="title"><b>Figure�12.1.�IDMAP: Group SID-to-GID Resolution.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/idmap-sid2gid.png" width="270" alt="IDMAP: Group SID-to-GID Resolution."></div></div></div><br class="figure-break"><div class="figure"><a name="idmap-gid2sid"></a><p class="title"><b>Figure�12.2.�IDMAP: GID Resolution to Matching SID.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/idmap-gid2sid.png" width="270" alt="IDMAP: GID Resolution to Matching SID."></div></div></div><br class="figure-break"><p>
44
<a class="indexterm" name="id359649"></a>
45
<a class="indexterm" name="id359656"></a>
46
<a class="indexterm" name="id359662"></a>
47
<a class="indexterm" name="id359671"></a>
44
<a class="indexterm" name="id382629"></a>
45
<a class="indexterm" name="id382636"></a>
46
<a class="indexterm" name="id382643"></a>
47
<a class="indexterm" name="id382652"></a>
48
48
In both cases, when winbindd is not running, only locally resolvable groups can be recognized. Please refer to
49
<a href="groupmapping.html#idmap-sid2gid" title="Figure�12.1.�IDMAP: Group SID-to-GID Resolution.">IDMAP: Group SID-to-GID Resolution</a> and <a href="groupmapping.html#idmap-gid2sid" title="Figure�12.2.�IDMAP: GID Resolution to Matching SID.">IDMAP: GID Resolution to Matching SID</a>. The <code class="literal">net groupmap</code> is
50
used to establish UNIX group to NT SID mappings as shown in <a href="groupmapping.html#idmap-store-gid2sid" title="Figure�12.3.�IDMAP Storing Group Mappings.">IDMAP: storing
49
<a class="link" href="groupmapping.html#idmap-sid2gid" title="Figure�12.1.�IDMAP: Group SID-to-GID Resolution.">IDMAP: Group SID-to-GID Resolution</a> and <a class="link" href="groupmapping.html#idmap-gid2sid" title="Figure�12.2.�IDMAP: GID Resolution to Matching SID.">IDMAP: GID Resolution to Matching SID</a>. The <code class="literal">net groupmap</code> is
50
used to establish UNIX group to NT SID mappings as shown in <a class="link" href="groupmapping.html#idmap-store-gid2sid" title="Figure�12.3.�IDMAP Storing Group Mappings.">IDMAP: storing
51
51
group mappings</a>.
52
52
</p><div class="figure"><a name="idmap-store-gid2sid"></a><p class="title"><b>Figure�12.3.�IDMAP Storing Group Mappings.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/idmap-store-gid2sid.png" width="270" alt="IDMAP Storing Group Mappings."></div></div></div><br class="figure-break"><p>
53
<a class="indexterm" name="id359752"></a>
54
<a class="indexterm" name="id359759"></a>
55
<a class="indexterm" name="id359766"></a>
56
<a class="indexterm" name="id359772"></a>
53
<a class="indexterm" name="id382733"></a>
54
<a class="indexterm" name="id382739"></a>
55
<a class="indexterm" name="id382746"></a>
56
<a class="indexterm" name="id382753"></a>
57
57
Administrators should be aware that where <code class="filename">smb.conf</code> group interface scripts make
58
58
direct calls to the UNIX/Linux system tools (the shadow utilities, <code class="literal">groupadd</code>,
59
59
<code class="literal">groupdel</code>, and <code class="literal">groupmod</code>), the resulting UNIX/Linux group names will be subject
62
62
<code class="literal">Engineering Managers</code> will attempt to create an identically named
63
63
UNIX/Linux group, an attempt that will of course fail.
65
<a class="indexterm" name="id359816"></a>
66
<a class="indexterm" name="id359822"></a>
65
<a class="indexterm" name="id382796"></a>
66
<a class="indexterm" name="id382803"></a>
67
67
There are several possible workarounds for the operating system tools limitation. One
68
68
method is to use a script that generates a name for the UNIX/Linux system group that
69
69
fits the operating system limits and that then just passes the UNIX/Linux group ID (GID)
70
70
back to the calling Samba interface. This will provide a dynamic workaround solution.
72
<a class="indexterm" name="id359835"></a>
72
<a class="indexterm" name="id382816"></a>
73
73
Another workaround is to manually create a UNIX/Linux group, then manually create the
74
74
MS Windows NT4/200x group on the Samba server, and then use the <code class="literal">net groupmap</code>
75
75
tool to connect the two to each other.
76
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id359854"></a>Discussion</h2></div></div></div><p>
77
<a class="indexterm" name="id359862"></a>
78
<a class="indexterm" name="id359868"></a>
76
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id382834"></a>Discussion</h2></div></div></div><p>
77
<a class="indexterm" name="id382842"></a>
78
<a class="indexterm" name="id382849"></a>
79
79
When you install <span class="application">MS Windows NT4/200x</span> on a computer, the installation
80
80
program creates default users and groups, notably the <code class="constant">Administrators</code> group,
81
81
and gives that group privileges necessary to perform essential system tasks,
82
82
such as the ability to change the date and time or to kill (or close) any process running on the
85
<a class="indexterm" name="id359891"></a>
85
<a class="indexterm" name="id382871"></a>
86
86
The <code class="constant">Administrator</code> user is a member of the <code class="constant">Administrators</code> group, and thus inherits
87
87
<code class="constant">Administrators</code> group privileges. If a <code class="constant">joe</code> user is created to be a member of the
88
88
<code class="constant">Administrators</code> group, <code class="constant">joe</code> has exactly the same rights as the user
89
89
<code class="constant">Administrator</code>.
91
<a class="indexterm" name="id359927"></a>
92
<a class="indexterm" name="id359934"></a>
93
<a class="indexterm" name="id359941"></a>
94
<a class="indexterm" name="id359948"></a>
91
<a class="indexterm" name="id382908"></a>
92
<a class="indexterm" name="id382915"></a>
93
<a class="indexterm" name="id382921"></a>
94
<a class="indexterm" name="id382928"></a>
95
95
When an MS Windows NT4/200x/XP machine is made a domain member, the “<span class="quote">Domain Admins</span>” group of the
96
96
PDC is added to the local <code class="constant">Administrators</code> group of the workstation. Every member of the
97
97
<code class="constant">Domain Admins</code> group inherits the rights of the local <code class="constant">Administrators</code> group when
98
98
logging on the workstation.
100
<a class="indexterm" name="id359974"></a>
101
<a class="indexterm" name="id359981"></a>
100
<a class="indexterm" name="id382955"></a>
101
<a class="indexterm" name="id382961"></a>
102
102
The following steps describe how to make Samba PDC users members of the <code class="constant">Domain Admins</code> group.
103
103
</p><div class="orderedlist"><ol type="1"><li><p>
104
104
Create a UNIX group (usually in <code class="filename">/etc/group</code>); let's call it <code class="constant">domadm</code>.
106
<a class="indexterm" name="id360017"></a>
106
<a class="indexterm" name="id382998"></a>
107
107
Add to this group the users that must be “<span class="quote">Administrators</span>”. For example,
108
108
if you want <code class="constant">joe, john</code>, and <code class="constant">mary</code> to be administrators,
109
109
your entry in <code class="filename">/etc/group</code> will look like this:
135
135
The <code class="literal">ntgroup</code> value must be in quotes if it contains space characters to prevent
136
136
the space from being interpreted as a command delimiter.
138
<a class="indexterm" name="id360151"></a>
139
<a class="indexterm" name="id360157"></a>
138
<a class="indexterm" name="id383131"></a>
139
<a class="indexterm" name="id383138"></a>
140
140
Be aware that the RID parameter is an unsigned 32-bit integer that should
141
141
normally start at 1000. However, this RID must not overlap with any RID assigned
142
142
to a user. Verification for this is done differently depending on the passdb backend
143
143
you are using. Future versions of the tools may perform the verification automatically,
144
144
but for now the burden is on you.
145
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id360168"></a>Warning: User Private Group Problems</h3></div></div></div><p>
146
<a class="indexterm" name="id360176"></a>
147
<a class="indexterm" name="id360183"></a>
148
<a class="indexterm" name="id360190"></a>
145
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id383149"></a>Warning: User Private Group Problems</h3></div></div></div><p>
146
<a class="indexterm" name="id383157"></a>
147
<a class="indexterm" name="id383164"></a>
148
<a class="indexterm" name="id383170"></a>
149
149
Windows does not permit user and group accounts to have the same name.
150
150
This has serious implications for all sites that use private group accounts.
151
151
A private group account is an administrative practice whereby users are each
152
152
given their own group account. Red Hat Linux, as well as several free distributions
153
153
of Linux, by default create private groups.
155
<a class="indexterm" name="id360203"></a>
156
<a class="indexterm" name="id360210"></a>
155
<a class="indexterm" name="id383184"></a>
156
<a class="indexterm" name="id383190"></a>
157
157
When mapping a UNIX/Linux group to a Windows group account, all conflict can
158
158
be avoided by assuring that the Windows domain group name does not overlap
159
159
with any user account name.
160
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id360220"></a>Nested Groups: Adding Windows Domain Groups to Windows Local Groups</h3></div></div></div><a class="indexterm" name="id360226"></a><p>
161
<a class="indexterm" name="id360238"></a>
160
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id383201"></a>Nested Groups: Adding Windows Domain Groups to Windows Local Groups</h3></div></div></div><a class="indexterm" name="id383207"></a><p>
161
<a class="indexterm" name="id383218"></a>
162
162
This functionality is known as <code class="constant">nested groups</code> and was first added to
165
<a class="indexterm" name="id360252"></a>
165
<a class="indexterm" name="id383233"></a>
166
166
All MS Windows products since the release of Windows NT 3.10 support the use of nested groups.
167
167
Many Windows network administrators depend on this capability because it greatly simplifies security
170
<a class="indexterm" name="id360264"></a>
171
<a class="indexterm" name="id360271"></a>
172
<a class="indexterm" name="id360278"></a>
173
<a class="indexterm" name="id360284"></a>
174
<a class="indexterm" name="id360291"></a>
175
<a class="indexterm" name="id360298"></a>
176
<a class="indexterm" name="id360305"></a>
170
<a class="indexterm" name="id383245"></a>
171
<a class="indexterm" name="id383251"></a>
172
<a class="indexterm" name="id383258"></a>
173
<a class="indexterm" name="id383265"></a>
174
<a class="indexterm" name="id383272"></a>
175
<a class="indexterm" name="id383279"></a>
176
<a class="indexterm" name="id383285"></a>
177
177
The nested group architecture was designed with the premise that day-to-day user and group membership
178
178
management should be performed on the domain security database. The application of group security
179
179
should be implemented on domain member servers using only local groups. On the domain member server,
180
180
all file system security controls are then limited to use of the local groups, which will contain
181
181
domain global groups and domain global users.
183
<a class="indexterm" name="id360319"></a>
184
<a class="indexterm" name="id360326"></a>
185
<a class="indexterm" name="id360332"></a>
183
<a class="indexterm" name="id383299"></a>
184
<a class="indexterm" name="id383306"></a>
185
<a class="indexterm" name="id383313"></a>
186
186
You may ask, What are the benefits of this arrangement? The answer is obvious to those who have plumbed
187
187
the dark depths of Windows networking architecture. Consider for a moment a server on which are stored
188
188
200,000 files, each with individual domain user and domain group settings. The company that owns the
201
201
to delete the <code class="constant">Account Unknown</code> membership entries inside local groups with appropriate
202
202
entries for domain global groups in the new domain that the server has been made a member of.
204
<a class="indexterm" name="id360386"></a>
205
<a class="indexterm" name="id360393"></a>
206
<a class="indexterm" name="id360400"></a>
207
<a class="indexterm" name="id360407"></a>
208
<a class="indexterm" name="id360414"></a>
209
<a class="indexterm" name="id360420"></a>
210
<a class="indexterm" name="id360427"></a>
211
<a class="indexterm" name="id360434"></a>
204
<a class="indexterm" name="id383367"></a>
205
<a class="indexterm" name="id383373"></a>
206
<a class="indexterm" name="id383380"></a>
207
<a class="indexterm" name="id383387"></a>
208
<a class="indexterm" name="id383394"></a>
209
<a class="indexterm" name="id383401"></a>
210
<a class="indexterm" name="id383408"></a>
211
<a class="indexterm" name="id383414"></a>
212
212
Another prominent example of the use of nested groups involves implementation of administrative privileges
213
213
on domain member workstations and servers. Administrative privileges are given to all members of the
214
214
built-in local group <code class="constant">Administrators</code> on each domain member machine. To ensure that all domain
242
242
group. By definition, it can only contain user objects, which can then be faked to be member of the
243
243
UNIX/Linux group <code class="constant">demo</code>.
245
<a class="indexterm" name="id360571"></a>
246
<a class="indexterm" name="id360578"></a>
247
<a class="indexterm" name="id360585"></a>
248
<a class="indexterm" name="id360591"></a>
249
<a class="indexterm" name="id360598"></a>
250
<a class="indexterm" name="id360605"></a>
251
<a class="indexterm" name="id360612"></a>
245
<a class="indexterm" name="id383552"></a>
246
<a class="indexterm" name="id383558"></a>
247
<a class="indexterm" name="id383565"></a>
248
<a class="indexterm" name="id383572"></a>
249
<a class="indexterm" name="id383579"></a>
250
<a class="indexterm" name="id383585"></a>
251
<a class="indexterm" name="id383592"></a>
252
252
To enable the use of nested groups, <code class="literal">winbindd</code> must be used with NSS winbind.
253
253
Creation and administration of the local groups is done best via the Windows Domain User Manager or its
254
254
Samba equivalent, the utility <code class="literal">net rpc group</code>. Creating the local group
277
277
<code class="constant">demo</code>. The users from the foreign domain who are members of the group that has been
278
278
added to the <code class="constant">demo</code> group now have the same local access permissions as local domain
280
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id360749"></a>Important Administrative Information</h3></div></div></div><p>
280
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id383730"></a>Important Administrative Information</h3></div></div></div><p>
281
281
Administrative rights are necessary in two specific forms:
282
282
</p><div class="orderedlist"><ol type="1"><li><p>For Samba-3 domain controllers and domain member servers/clients.</p></li><li><p>To manage domain member Windows workstations.</p></li></ol></div><p>
283
<a class="indexterm" name="id360778"></a>
284
<a class="indexterm" name="id360785"></a>
285
<a class="indexterm" name="id360792"></a>
283
<a class="indexterm" name="id383759"></a>
284
<a class="indexterm" name="id383766"></a>
285
<a class="indexterm" name="id383772"></a>
286
286
Versions of Samba up to and including 3.0.10 do not provide a means for assigning rights and privileges
287
287
that are necessary for system administration tasks from a Windows domain member client machine, so
288
288
domain administration tasks such as adding, deleting, and changing user and group account information, and
289
289
managing workstation domain membership accounts, can be handled by any account other than root.
291
<a class="indexterm" name="id360805"></a>
292
<a class="indexterm" name="id360812"></a>
293
<a class="indexterm" name="id360819"></a>
294
Samba-3.0.11 introduced a new privilege management interface (see <a href="rights.html" title="Chapter�15.�User Rights and Privileges">User Rights and Privileges</a>)
291
<a class="indexterm" name="id383786"></a>
292
<a class="indexterm" name="id383793"></a>
293
<a class="indexterm" name="id383800"></a>
294
Samba-3.0.11 introduced a new privilege management interface (see <a class="link" href="rights.html" title="Chapter�15.�User Rights and Privileges">User Rights and Privileges</a>)
295
295
that permits these tasks to be delegated to non-root (i.e., accounts other than the equivalent of the
296
296
MS Windows Administrator) accounts.
298
<a class="indexterm" name="id360838"></a>
299
<a class="indexterm" name="id360845"></a>
298
<a class="indexterm" name="id383819"></a>
299
<a class="indexterm" name="id383825"></a>
300
300
Administrative tasks on a Windows domain member workstation can be done by anyone who is a member of the
301
301
<code class="constant">Domain Admins</code> group. This group can be mapped to any convenient UNIX group.
302
</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id360858"></a>Applicable Only to Versions Earlier than 3.0.11</h4></div></div></div><p>
303
<a class="indexterm" name="id360866"></a>
302
</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id383838"></a>Applicable Only to Versions Earlier than 3.0.11</h4></div></div></div><p>
303
<a class="indexterm" name="id383846"></a>
304
304
Administrative tasks on UNIX/Linux systems, such as adding users or groups, requires
305
305
<code class="constant">root</code>-level privilege. The addition of a Windows client to a Samba domain involves the
306
306
addition of a user account for the Windows client.
308
<a class="indexterm" name="id360881"></a>
309
<a class="indexterm" name="id360888"></a>
308
<a class="indexterm" name="id383862"></a>
309
<a class="indexterm" name="id383869"></a>
310
310
Many UNIX administrators continue to request that the Samba Team make it possible to add Windows workstations, or
311
311
the ability to add, delete, or modify user accounts, without requiring <code class="constant">root</code> privileges.
312
312
Such a request violates every understanding of basic UNIX system security.
314
<a class="indexterm" name="id360904"></a>
315
<a class="indexterm" name="id360911"></a>
316
<a class="indexterm" name="id360918"></a>
317
<a class="indexterm" name="id360925"></a>
318
<a class="indexterm" name="id360931"></a>
319
<a class="indexterm" name="id360938"></a>
314
<a class="indexterm" name="id383885"></a>
315
<a class="indexterm" name="id383892"></a>
316
<a class="indexterm" name="id383898"></a>
317
<a class="indexterm" name="id383905"></a>
318
<a class="indexterm" name="id383912"></a>
319
<a class="indexterm" name="id383919"></a>
320
320
There is no safe way to provide access on a UNIX/Linux system without providing
321
321
<code class="constant">root</code>-level privileges. Provision of <code class="constant">root</code> privileges can be done
322
322
either by logging on to the Domain as the user <code class="constant">root</code> or by permitting particular users to
324
324
can use tools like the NT4 Domain User Manager and the NT4 Domain Server Manager to manage user and group
325
325
accounts as well as domain member server and client accounts. This level of privilege is also needed to manage
326
326
share-level ACLs.
327
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id360970"></a>Default Users, Groups, and Relative Identifiers</h3></div></div></div><p>
328
<a class="indexterm" name="id360978"></a>
329
<a class="indexterm" name="id360986"></a>
330
<a class="indexterm" name="id360993"></a>
331
<a class="indexterm" name="id361000"></a>
332
<a class="indexterm" name="id361007"></a>
333
<a class="indexterm" name="id361013"></a>
334
<a class="indexterm" name="id361020"></a>
335
<a class="indexterm" name="id361027"></a>
327
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id383950"></a>Default Users, Groups, and Relative Identifiers</h3></div></div></div><p>
328
<a class="indexterm" name="id383958"></a>
329
<a class="indexterm" name="id383967"></a>
330
<a class="indexterm" name="id383974"></a>
331
<a class="indexterm" name="id383980"></a>
332
<a class="indexterm" name="id383987"></a>
333
<a class="indexterm" name="id383994"></a>
334
<a class="indexterm" name="id384001"></a>
335
<a class="indexterm" name="id384008"></a>
336
336
When first installed, Windows NT4/200x/XP are preconfigured with certain user, group, and
337
337
alias entities. Each has a well-known RID. These must be preserved for continued
338
338
integrity of operation. Samba must be provisioned with certain essential domain groups that require
340
340
domain groups are automatically created. It is the LDAP administrator's responsibility to create
341
341
(provision) the default NT groups.
343
<a class="indexterm" name="id361045"></a>
344
<a class="indexterm" name="id361052"></a>
345
<a class="indexterm" name="id361058"></a>
346
<a class="indexterm" name="id361065"></a>
343
<a class="indexterm" name="id384025"></a>
344
<a class="indexterm" name="id384032"></a>
345
<a class="indexterm" name="id384039"></a>
346
<a class="indexterm" name="id384046"></a>
347
347
Each essential domain group must be assigned its respective well-known RID. The default users, groups,
348
aliases, and RIDs are shown in <a href="groupmapping.html#WKURIDS" title="Table�12.1.�Well-Known User Default RIDs">Well-Known User Default RIDs</a>.
348
aliases, and RIDs are shown in <a class="link" href="groupmapping.html#WKURIDS" title="Table�12.1.�Well-Known User Default RIDs">Well-Known User Default RIDs</a>.
349
349
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
350
<a class="indexterm" name="id361085"></a>
351
<a class="indexterm" name="id361092"></a>
352
<a class="indexterm" name="id361098"></a>
353
<a class="indexterm" name="id361105"></a>
354
<a class="indexterm" name="id361112"></a>
350
<a class="indexterm" name="id384066"></a>
351
<a class="indexterm" name="id384072"></a>
352
<a class="indexterm" name="id384079"></a>
353
<a class="indexterm" name="id384086"></a>
354
<a class="indexterm" name="id384093"></a>
355
355
It is the administrator's responsibility to create the essential domain groups and to assign each
358
<a class="indexterm" name="id361123"></a>
359
<a class="indexterm" name="id361130"></a>
358
<a class="indexterm" name="id384103"></a>
359
<a class="indexterm" name="id384110"></a>
360
360
It is permissible to create any domain group that may be necessary; just make certain that the essential
361
361
domain groups (well known) have been created and assigned their default RIDs. Other groups you create may
362
362
be assigned any arbitrary RID you care to use.
381
381
For complete details on <code class="literal">net groupmap</code>, refer to the net(8) man page.
382
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id361647"></a>Configuration Scripts</h2></div></div></div><p>
382
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id384627"></a>Configuration Scripts</h2></div></div></div><p>
383
383
Everyone needs tools. Some of us like to create our own, others prefer to use canned tools
384
384
(i.e., prepared by someone else for general use).
385
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id361657"></a>Sample <code class="filename">smb.conf</code> Add Group Script</h3></div></div></div><p>
386
<a class="indexterm" name="id361671"></a>
387
<a class="indexterm" name="id361678"></a>
388
<a class="indexterm" name="id361684"></a>
389
<a class="indexterm" name="id361691"></a>
390
<a class="indexterm" name="id361698"></a>
385
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id384638"></a>Sample <code class="filename">smb.conf</code> Add Group Script</h3></div></div></div><p>
386
<a class="indexterm" name="id384651"></a>
387
<a class="indexterm" name="id384658"></a>
388
<a class="indexterm" name="id384665"></a>
389
<a class="indexterm" name="id384672"></a>
390
<a class="indexterm" name="id384678"></a>
391
391
A script to create complying group names for use by the Samba group interfaces
392
is provided in <a href="groupmapping.html#smbgrpadd.sh" title="Example�12.1.�smbgrpadd.sh">smbgrpadd.sh</a>. This script
392
is provided in <a class="link" href="groupmapping.html#smbgrpadd.sh" title="Example�12.1.�smbgrpadd.sh">smbgrpadd.sh</a>. This script
393
393
adds a temporary entry in the <code class="filename">/etc/group</code> file and then renames
394
394
it to the desired name. This is an example of a method to get around operating
395
395
system maintenance tool limitations such as those present in some version of the
413
413
</pre></div></div><p><br class="example-break">
415
The <code class="filename">smb.conf</code> entry for the above script shown in <a href="groupmapping.html#smbgrpadd" title="Example�12.2.�Configuration of smb.conf for the add group Script">the configuration of
415
The <code class="filename">smb.conf</code> entry for the above script shown in <a class="link" href="groupmapping.html#smbgrpadd" title="Example�12.2.�Configuration of smb.conf for the add group Script">the configuration of
416
416
<code class="filename">smb.conf</code> for the add group Script</a> demonstrates how it may be used.
418
</p><div class="example"><a name="smbgrpadd"></a><p class="title"><b>Example�12.2.�Configuration of <code class="filename">smb.conf</code> for the add group Script</b></p><div class="example-contents"><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id361802"></a><em class="parameter"><code>add group script = /path_to_tool/smbgrpadd.sh "%g"</code></em></td></tr></table></div></div><p><br class="example-break">
419
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id361818"></a>Script to Configure Group Mapping</h3></div></div></div><p>
420
<a class="indexterm" name="id361826"></a>
418
</p><div class="example"><a name="smbgrpadd"></a><p class="title"><b>Example�12.2.�Configuration of <code class="filename">smb.conf</code> for the add group Script</b></p><div class="example-contents"><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id384783"></a><em class="parameter"><code>add group script = /path_to_tool/smbgrpadd.sh "%g"</code></em></td></tr></table></div></div><p><br class="example-break">
419
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id384798"></a>Script to Configure Group Mapping</h3></div></div></div><p>
420
<a class="indexterm" name="id384806"></a>
421
421
In our example we have created a UNIX/Linux group called <code class="literal">ntadmin</code>.
422
422
Our script will create the additional groups <code class="literal">Orks</code>, <code class="literal">Elves</code>, and <code class="literal">Gnomes</code>.
423
423
It is a good idea to save this shell script for later use just in case you ever need to rebuild your mapping database.
424
424
For the sake of convenience we elect to save this script as a file called <code class="filename">initGroups.sh</code>.
425
This script is given in <a href="groupmapping.html#set-group-map" title="Example�12.3.�Script to Set Group Mapping">intGroups.sh</a>.
426
<a class="indexterm" name="id361873"></a>
425
This script is given in <a class="link" href="groupmapping.html#set-group-map" title="Example�12.3.�Script to Set Group Mapping">intGroups.sh</a>.
426
<a class="indexterm" name="id384852"></a>
427
427
</p><div class="example"><a name="set-group-map"></a><p class="title"><b>Example�12.3.�Script to Set Group Mapping</b></p><div class="example-contents"><pre class="programlisting">
450
450
trouble. Commencing with Samba-3.0.23 this annomaly has been fixed - thus all Windows groups
451
451
must now be manually and explicitly created and mapped to a valid UNIX GID by the Samba
453
</p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id361932"></a>Common Errors</h2></div></div></div><p>
453
</p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id384912"></a>Common Errors</h2></div></div></div><p>
454
454
At this time there are many little surprises for the unwary administrator. In a real sense
455
455
it is imperative that every step of automated control scripts be carefully tested
456
456
manually before putting it into active service.
457
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id361943"></a>Adding Groups Fails</h3></div></div></div><p>
458
<a class="indexterm" name="id361951"></a>
457
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id384922"></a>Adding Groups Fails</h3></div></div></div><p>
458
<a class="indexterm" name="id384930"></a>
459
459
This is a common problem when the <code class="literal">groupadd</code> is called directly
460
by the Samba interface script for the <a class="indexterm" name="id361964"></a>add group script in
460
by the Samba interface script for the <a class="link" href="smb.conf.5.html#ADDGROUPSCRIPT">add group script</a> in
461
461
the <code class="filename">smb.conf</code> file.
463
<a class="indexterm" name="id361981"></a>
464
<a class="indexterm" name="id361988"></a>
463
<a class="indexterm" name="id384965"></a>
464
<a class="indexterm" name="id384972"></a>
465
465
The most common cause of failure is an attempt to add an MS Windows group account
466
466
that has an uppercase character and/or a space character in it.
468
<a class="indexterm" name="id361999"></a>
468
<a class="indexterm" name="id384983"></a>
469
469
There are three possible workarounds. First, use only group names that comply
470
470
with the limitations of the UNIX/Linux <code class="literal">groupadd</code> system tool.
471
471
Second, it involves the use of the script mentioned earlier in this chapter, and
472
472
third is the option is to manually create a UNIX/Linux group account that can substitute
473
473
for the MS Windows group name, then use the procedure listed above to map that group
474
474
to the MS Windows group.
475
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id362018"></a>Adding Domain Users to the Workstation Power Users Group</h3></div></div></div><p>“<span class="quote">
475
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id385002"></a>Adding Domain Users to the Workstation Power Users Group</h3></div></div></div><p>“<span class="quote">
476
476
What must I do to add domain users to the Power Users group?
477
477
</span>”</p><p>
478
<a class="indexterm" name="id362031"></a>
478
<a class="indexterm" name="id385015"></a>
479
479
The Power Users group is a group that is local to each Windows 200x/XP Professional workstation.
480
480
You cannot add the Domain Users group to the Power Users group automatically, it must be done on
481
481
each workstation by logging in as the local workstation <span class="emphasis"><em>administrator</em></span> and