1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter11.Group Mapping MS Windows and UNIX</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.66.1"><link rel="start" href="index.html" title="The Official Samba-3 HOWTO and Reference Guide"><link rel="up" href="optional.html" title="PartIII.Advanced Configuration"><link rel="prev" href="passdb.html" title="Chapter10.Account Information Databases"><link rel="next" href="idmapper.html" title="Chapter12.Identity Mapping (IDMAP)"></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">Chapter11.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">PartIII.Advanced Configuration</th><td width="20%" align="right"><a accesskey="n" href="idmapper.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>Chapter11.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><tt class="email"><<a href="mailto:jht@samba.org">jht@samba.org</a>></tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jean Franois</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><tt class="email"><<a href="mailto:jerry@samba.org">jerry@samba.org</a>></tt></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#id2556422">Features and Benefits</a></span></dt><dt><span class="sect1"><a href="groupmapping.html#id2556759">Discussion</a></span></dt><dd><dl><dt><span class="sect2"><a href="groupmapping.html#id2557016">Important Administrative Information</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id2557139">Default Users, Groups and Relative Identifiers</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id2557657">Example Configuration</a></span></dt></dl></dd><dt><span class="sect1"><a href="groupmapping.html#id2557722">Configuration Scripts</a></span></dt><dd><dl><dt><span class="sect2"><a href="groupmapping.html#id2557734">Sample <tt class="filename">smb.conf</tt> Add Group Script</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id2557885">Script to Configure Group Mapping</a></span></dt></dl></dd><dt><span class="sect1"><a href="groupmapping.html#id2557976">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="groupmapping.html#id2557989">Adding Groups Fails</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id2558043">Adding MS Windows Groups to MS Windows Groups Fails</a></span></dt><dt><span class="sect2"><a href="groupmapping.html#id2558064">Adding <span class="emphasis"><em>Domain Users</em></span> to the <span class="emphasis"><em>Power Users</em></span> Group</a></span></dt></dl></dd></dl></div><p>
<a class="indexterm" name="id2556350"></a>
Starting with Samba-3, new group mapping functionality is available to create associations
between Windows group SIDs and UNIX groups. The <span><b class="command">groupmap</b></span> subcommand
included with the <span class="application">net</span> tool can be used to manage these associations.
</p><p>
The new facility for mapping NT Groups to UNIX system groups allows the administrator to decide
which NT Domain Groups are to be exposed to MS Windows clients. Only those NT Groups that map
to a UNIX group that has a value other than the default (<tt class="constant">-1</tt>) will be exposed
in group selection lists in tools that access domain users and groups.
</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
<a class="indexterm" name="id2556392"></a>
The <i class="parameter"><tt>domain admin group</tt></i> parameter has been removed in Samba-3 and should no longer
be specified in <tt class="filename">smb.conf</tt>. In Samba-2.2.x, this parameter was used to give the listed users membership in the
<tt class="constant">Domain Admins</tt> Windows group which gave local admin rights on their workstations
(in default configurations).
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2556422"></a>Features and Benefits</h2></div></div></div><p>
Samba allows the administrator to create MS Windows NT4/200x group accounts and to
arbitrarily associate them with UNIX/Linux group accounts.
</p><p>
<a class="indexterm" name="id2556435"></a>
<a class="indexterm" name="id2556442"></a>
<a class="indexterm" name="id2556448"></a>
Group accounts can be managed using the MS Windows NT4 or MS Windows 200x/XP Professional MMC tools.
Appropriate interface scripts should be provided in <tt class="filename">smb.conf</tt> if it is desired that UNIX/Linux system
accounts should be automatically created when these tools are used. In the absence of these scripts, and
so long as <span><b class="command">winbindd</b></span> is running, Samba group accounts that are created using these
tools will be allocated UNIX UIDs/GIDs from the ID range specified by the
<a class="indexterm" name="id2556475"></a>idmap uid/<a class="indexterm" name="id2556482"></a>idmap gid
parameters in the <tt class="filename">smb.conf</tt> file.
</p><div class="figure"><a name="idmap-sid2gid"></a><p class="title"><b>Figure11.1.IDMAP: group SID to GID resolution.</b></p><div class="mediaobject"><img src="images/idmap-sid2gid.png" width="270" alt="IDMAP: group SID to GID resolution."></div></div><div class="figure"><a name="idmap-gid2sid"></a><p class="title"><b>Figure11.2.IDMAP: GID resolution to matching SID.</b></p><div class="mediaobject"><img src="images/idmap-gid2sid.png" width="270" alt="IDMAP: GID resolution to matching SID."></div></div><p>
<a class="indexterm" name="id2556584"></a>
In both cases, when winbindd is not running, only locally resolvable groups can be recognized. Please refer to
<a href="groupmapping.html#idmap-sid2gid" title="Figure11.1.IDMAP: group SID to GID resolution.">IDMAP: group SID to GID resolution</a> and <a href="groupmapping.html#idmap-gid2sid" title="Figure11.2.IDMAP: GID resolution to matching SID.">IDMAP: GID resolution to matching SID</a>.
The <span><b class="command">net groupmap</b></span> is
used to establish UNIX group to NT SID mappings as shown in <a href="groupmapping.html#idmap-store-gid2sid" title="Figure11.3.IDMAP storing group mappings.">IDMAP: storing group mappings</a>.
</p><div class="figure"><a name="idmap-store-gid2sid"></a><p class="title"><b>Figure11.3.IDMAP storing group mappings.</b></p><div class="mediaobject"><img src="images/idmap-store-gid2sid.png" width="270" alt="IDMAP storing group mappings."></div></div><p>
<a class="indexterm" name="id2556673"></a>
<a class="indexterm" name="id2556680"></a>
Administrators should be aware that where <tt class="filename">smb.conf</tt> group interface scripts make
direct calls to the UNIX/Linux system tools (the shadow utilities, <span><b class="command">groupadd</b></span>,
<span><b class="command">groupdel</b></span>, and <span><b class="command">groupmod</b></span>), the resulting UNIX/Linux group names will be subject
to any limits imposed by these tools. If the tool does not allow upper case characters
or space characters, then the creation of an MS Windows NT4/200x style group of
<span class="emphasis"><em>Engineering Managers</em></span> will attempt to create an identically named
UNIX/Linux group, an attempt that will of course fail.
</p><p>
<a class="indexterm" name="id2556725"></a>
<a class="indexterm" name="id2556732"></a>
There are several possible work-arounds for the operating system tools limitation. One
method is to use a script that generates a name for the UNIX/Linux system group that
fits the operating system limits, and that then just passes the UNIX/Linux group ID (GID)
back to the calling Samba interface. This will provide a dynamic work-around solution.
</p><p>
Another work-around is to manually create a UNIX/Linux group, then manually create the
MS Windows NT4/200x group on the Samba server and then use the <span><b class="command">net groupmap</b></span>
tool to connect the two to each other.
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2556759"></a>Discussion</h2></div></div></div><p>
When installing <span class="application">MS Windows NT4/200x</span> on a computer, the installation
program creates default users and groups, notably the <tt class="constant">Administrators</tt> group,
and gives that group privileges necessary privileges to perform essential system tasks,
such as the ability to change the date and time or to kill (or close) any process running on the
local machine.
</p><p>
<a class="indexterm" name="id2556785"></a>
The <tt class="constant">Administrator</tt> user is a member of the <tt class="constant">Administrators</tt> group, and thus inherits
<tt class="constant">Administrators</tt> group privileges. If a <tt class="constant">joe</tt> user is created to be a member of the
<tt class="constant">Administrators</tt> group, <tt class="constant">joe</tt> has exactly the same rights as the user,
<tt class="constant">Administrator</tt>.
</p><p>
When an MS Windows NT4/200x/XP machine is made a Domain Member, the “<span class="quote"><span class="emphasis"><em>Domain Admins</em></span></span>” group of the
PDC is added to the local <tt class="constant">Administrators</tt> group of the workstation. Every member of the
<tt class="constant">Domain Administrators</tt> group inherits the rights of the local <tt class="constant">Administrators</tt> group when
logging on the workstation.
</p><p>
The following steps describe how to make Samba PDC users members of the <tt class="constant">Domain Admins</tt> group?
</p><div class="orderedlist"><ol type="1"><li><p>
Create a UNIX group (usually in <tt class="filename">/etc/group</tt>), let's call it <tt class="constant">domadm</tt>.
</p></li><li><p>
Add to this group the users that must be “<span class="quote"><span class="emphasis"><em>Administrators</em></span></span>”. For example,
if you want <tt class="constant">joe, john</tt> and <tt class="constant">mary</tt> to be administrators,
your entry in <tt class="filename">/etc/group</tt> will look like this:
</p><pre class="programlisting">
domadm:x:502:joe,john,mary
</pre><p>
</p></li><li><p>
Map this domadm group to the “<span class="quote"><span class="emphasis"><em>Domain Admins</em></span></span>” group by running the command:
</p><p>
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>net groupmap add ntgroup="Domain Admins" unixgroup=domadm</tt></b>
</pre><p>
</p><p>
<a class="indexterm" name="id2556940"></a>
The quotes around “<span class="quote"><span class="emphasis"><em>Domain Admins</em></span></span>” are necessary due to the space in the group name.
Also make sure to leave no white-space surrounding the equal character (=).
</p></li></ol></div><p>
Now <tt class="constant">joe, john</tt> and <tt class="constant">mary</tt> are domain administrators.
</p><p>
<a class="indexterm" name="id2556970"></a>
It is possible to map any arbitrary UNIX group to any Windows NT4/200x group as well as
making any UNIX group a Windows domain group. For example, if you wanted to include a
UNIX group (e.g., acct) in an ACL on a local file or printer on a Domain Member machine,
you would flag that group as a domain group by running the following on the Samba PDC:
</p><p>
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>net groupmap add rid=1000 ntgroup="Accounting" unixgroup=acct</tt></b>
</pre><p>
</p><p>
Be aware that the RID parameter is a unsigned 32-bit integer that should
normally start at 1000. However, this RID must not overlap with any RID assigned
to a user. Verification for this is done differently depending on the passdb backend
you are using. Future versions of the tools may perform the verification automatically,
but for now the burden is on you.
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2557016"></a>Important Administrative Information</h3></div></div></div><p>
Administrative rights are necessary in two specific forms:
</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>
Versions of Samba up to and including 3.0.10 do not provide a means for assigning rights and privileges
that are necessary for system administration tasks from a Windows Domain Member Client machine so that
domain administration tasks such as adding/deleting/changing user and group account information, and
managing workstation domain membership accounts, can be handled by any account other than root.
</p><p>
Samba-3.0.11 introduced a new privilege management interface (see <a href="rights.html" title="Chapter13.User Rights and Privileges">Chapter on Rights and Privileges</a>)
that permits these tasks to be delegated to non-root (i.e.: accounts other than the equivalent of the
MS Windows Administrator) account.
</p><p>
Administrative tasks on a Windows Domain Member workstation, can be done by anyone who is a member of the
<tt class="constant">Domain Admins</tt> group. This group can be mapped to any convenient UNIX group.
</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2557080"></a>Applicable Only to Versions Earlier than 3.0.11</h4></div></div></div><p>
Administrative tasks on UNIX/Linux systems, such as adding users or groups, requires <tt class="constant">root</tt>
level privilege. The addition of a Windows client to a Samba Domain involves the addition of a user account
for the Windows client.
</p><p>
Many UNIX administrators continue to request the Samba Team make it possible to add Windows workstations, or
to ability to add/delete or modify user accounts, without requiring <tt class="constant">root</tt> privileges.
Such a request violates every understanding of basic UNIX system security.
</p><p>
There is no safe way to provide access on a UNIX/Linux system without providing <tt class="constant">root</tt>
level privilege. Provision of <tt class="constant">root</tt> privileges can be done either by logging onto
the Domain as the user <tt class="constant">root</tt>, or by permitting particular users to use a UNIX account
that has a UID=0 in the <tt class="filename">/etc/passwd</tt> database. Users of such accounts can use tools
like the NT4 Domain User Manager, and the NT4 Domain Server Manager to manage user and group accounts as
well as Domain Member server and client accounts. This level of privilege is also needed to manage share
level ACLs.
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2557139"></a>Default Users, Groups and Relative Identifiers</h3></div></div></div><p>
<a class="indexterm" name="id2557147"></a>
<a class="indexterm" name="id2557156"></a>
When first installed, Microsoft Windows NT4/200x/XP are pre-configured with certain User, Group, and
Alias entities. Each has a well-known Relative Identifier (RID). These must be preserved for continued
integrity of operation. Samba must be provisioned with certain essential Domain Groups that require
the appropriate RID value. When Samba-3 is configured to use <tt class="constant">tdbsam</tt> the essential
Domain Groups are automatically created. It is the LDAP administrators' responsibility to create
(provision) the default NT Groups.
</p><p>
Each essential Domain Group must be assigned its respective well-known RID. The default Users, Groups,
Aliases, and RIDs are shown in <a href="groupmapping.html#WKURIDS" title="Table11.1.Well-Known User Default RIDs">Well-Known User Default RIDs</a> table.
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
When the <i class="parameter"><tt>passdb backend</tt></i> uses LDAP (<tt class="constant">ldapsam</tt>) it is the
administrators' responsibility to create the essential Domain Groups, and to assign each its default RID.
</p></div><p>
It is permissible to create any Domain Group that may be necessary, just make certain that the essential
Domain Groups (well known) have been created and assigned its default RID. Other groups you create may
be assigned any arbitrary RID you care to use.
</p><p>
Be sure to map each Domain Group to a UNIX system group. That is the only way to ensure that the group
will be available for use as an NT Domain Group.
</p><p>
</p><div class="table"><a name="WKURIDS"></a><p class="title"><b>Table11.1.Well-Known User Default RIDs</b></p><table summary="Well-Known User Default RIDs" border="1"><colgroup><col align="left"><col align="left"><col align="left"><col align="center"></colgroup><thead><tr><th align="left">Well-Known Entity</th><th align="left">RID</th><th align="left">Type</th><th align="left">Essential</th></tr></thead><tbody><tr><td align="left">Domain Administrator</td><td align="left">500</td><td align="left">User</td><td align="left">No</td></tr><tr><td align="left">Domain Guest</td><td align="left">501</td><td align="left">User</td><td align="left">No</td></tr><tr><td align="left">Domain KRBTGT</td><td align="left">502</td><td align="left">User</td><td align="left">No</td></tr><tr><td align="left">Domain Admins</td><td align="left">512</td><td align="left">Group</td><td align="left">Yes</td></tr><tr><td align="left">Domain Users</td><td align="left">513</td><td align="left">Group</td><td align="left">Yes</td></tr><tr><td align="left">Domain Guests</td><td align="left">514</td><td align="left">Group</td><td align="left">Yes</td></tr><tr><td align="left">Domain Computers</td><td align="left">515</td><td align="left">Group</td><td align="left">No</td></tr><tr><td align="left">Domain Controllers</td><td align="left">516</td><td align="left">Group</td><td align="left">No</td></tr><tr><td align="left">Domain Certificate Admins</td><td align="left">517</td><td align="left">Group</td><td align="left">No</td></tr><tr><td align="left">Domain Schema Admins</td><td align="left">518</td><td align="left">Group</td><td align="left">No</td></tr><tr><td align="left">Domain Enterprise Admins</td><td align="left">519</td><td align="left">Group</td><td align="left">No</td></tr><tr><td align="left">Domain Policy Admins</td><td align="left">520</td><td align="left">Group</td><td align="left">No</td></tr><tr><td align="left">Builtin Admins</td><td align="left">544</td><td align="left">Alias</td><td align="left">No</td></tr><tr><td align="left">Builtin users</td><td align="left">545</td><td align="left">Alias</td><td align="left">No</td></tr><tr><td align="left">Builtin Guests</td><td align="left">546</td><td align="left">Alias</td><td align="left">No</td></tr><tr><td align="left">Builtin Power Users</td><td align="left">547</td><td align="left">Alias</td><td align="left">No</td></tr><tr><td align="left">Builtin Account Operators</td><td align="left">548</td><td align="left">Alias</td><td align="left">No</td></tr><tr><td align="left">Builtin System Operators</td><td align="left">549</td><td align="left">Alias</td><td align="left">No</td></tr><tr><td align="left">Builtin Print Operators</td><td align="left">550</td><td align="left">Alias</td><td align="left">No</td></tr><tr><td align="left">Builtin Backup Operators</td><td align="left">551</td><td align="left">Alias</td><td align="left">No</td></tr><tr><td align="left">Builtin Replicator</td><td align="left">552</td><td align="left">Alias</td><td align="left">No</td></tr><tr><td align="left">Builtin RAS Servers</td><td align="left">553</td><td align="left">Alias</td><td align="left">No</td></tr></tbody></table></div><p>
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2557657"></a>Example Configuration</h3></div></div></div><p>
You can list the various groups in the mapping database by executing
<span><b class="command">net groupmap list</b></span>. Here is an example:
</p><a class="indexterm" name="id2557673"></a><p>
</p><pre class="screen">
<tt class="prompt">root# </tt> <b class="userinput"><tt>net groupmap list</tt></b>
Domain Admins (S-1-5-21-2547222302-1596225915-2414751004-512) -> domadmin
Domain Users (S-1-5-21-2547222302-1596225915-2414751004-513) -> domuser
Domain Guests (S-1-5-21-2547222302-1596225915-2414751004-514) -> domguest
</pre><p>
</p><p>
For complete details on <span><b class="command">net groupmap</b></span>, refer to the net(8) man page.
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2557722"></a>Configuration Scripts</h2></div></div></div><p>
Everyone needs tools. Some of us like to create our own, others prefer to use canned tools
(i.e., prepared by someone else for general use).
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2557734"></a>Sample <tt class="filename">smb.conf</tt> Add Group Script</h3></div></div></div><p>
<a class="indexterm" name="id2557748"></a>
<a class="indexterm" name="id2557754"></a>
A script to create complying group names for use by the Samba group interfaces
is provided in <a href="groupmapping.html#smbgrpadd.sh" title="Example11.1.smbgrpadd.sh">smbgrpadd.sh</a>. This script will
add a temporary entry in the <tt class="filename">/etc/group</tt> file and then rename
it to to the desired name. This is an example of a method to get around operating
system maintenance tool limititations such as that present in some version of the
<span><b class="command">groupadd</b></span> tool.
</p><a class="indexterm" name="id2557789"></a><p>
</p><div class="example"><a name="smbgrpadd.sh"></a><p class="title"><b>Example11.1.smbgrpadd.sh</b></p><pre class="programlisting">
#!/bin/bash
# Add the group using normal system groupadd tool.
groupadd smbtmpgrp00
thegid=`cat /etc/group | grep ^smbtmpgrp00 | cut -d ":" -f3`
# Now change the name to what we want for the MS Windows networking end
cp /etc/group /etc/group.bak
cat /etc/group.bak | sed "s/^smbtmpgrp00/$1/g" > /etc/group
# Now return the GID as would normally happen.
echo $thegid
exit 0
</pre></div><p>
</p><p>
The <tt class="filename">smb.conf</tt> entry for the above script would be something like that in <a href="groupmapping.html#smbgrpadd" title="Example11.2.Configuration of smb.conf for the add group script.">the following example</a>.
</p><div class="example"><a name="smbgrpadd"></a><p class="title"><b>Example11.2.Configuration of smb.conf for the add group script.</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><a class="indexterm" name="id2557866"></a><i class="parameter"><tt>
add group script = /path_to_tool/smbgrpadd.sh "%g"</tt></i></td></tr></table></div><p>
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2557885"></a>Script to Configure Group Mapping</h3></div></div></div><p>
In our example we have created a UNIX/Linux group called <span class="emphasis"><em>ntadmin</em></span>.
Our script will create the additional groups <span class="emphasis"><em>Orks</em></span>, <span class="emphasis"><em>Elves</em></span>, and <span class="emphasis"><em>Gnomes</em></span>.
It is a good idea to save this shell script for later re-use just in case you ever need to rebuild your mapping database.
For the sake of convenience we elect to save this script as a file called <tt class="filename">initGroups.sh</tt>.
This script is given in <a href="groupmapping.html#set-group-map" title="Example11.3.Script to Set Group Mapping">intGroups.sh</a>.
</p><p>
<a class="indexterm" name="id2557930"></a>
</p><div class="example"><a name="set-group-map"></a><p class="title"><b>Example11.3.Script to Set Group Mapping</b></p><pre class="programlisting">
#!/bin/bash
net groupmap modify ntgroup="Domain Admins" unixgroup=ntadmin
net groupmap modify ntgroup="Domain Users" unixgroup=users
net groupmap modify ntgroup="Domain Guests" unixgroup=nobody
groupadd Orks
groupadd Elves
groupadd Gnomes
net groupmap add ntgroup="Orks" unixgroup=Orks type=d
net groupmap add ntgroup="Elves" unixgroup=Elves type=d
net groupmap add ntgroup="Gnomes" unixgroup=Gnomes type=d
</pre></div><p>
</p><p>
Of course it is expected that the administrator will modify this to suit local needs.
For information regarding the use of the <span><b class="command">net groupmap</b></span> tool please
refer to the man page.
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2557976"></a>Common Errors</h2></div></div></div><p>
At this time there are many little surprises for the unwary administrator. In a real sense
it is imperative that every step of automated control scripts must be carefully tested
manually before putting them into active service.
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2557989"></a>Adding Groups Fails</h3></div></div></div><p>
This is a common problem when the <span><b class="command">groupadd</b></span> is called directly
by the Samba interface script for the <a class="indexterm" name="id2558005"></a>add group script in
the <tt class="filename">smb.conf</tt> file.
</p><p>
The most common cause of failure is an attempt to add an MS Windows group account
that has either an upper case character and/or a space character in it.
</p><p>
There are three possible work-arounds. First, use only group names that comply
with the limitations of the UNIX/Linux <span><b class="command">groupadd</b></span> system tool.
Second, it involves the use of the script mentioned earlier in this chapter, and
third is the option is to manually create a UNIX/Linux group account that can substitute
for the MS Windows group name, then use the procedure listed above to map that group
to the MS Windows group.
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2558043"></a>Adding MS Windows Groups to MS Windows Groups Fails</h3></div></div></div><a class="indexterm" name="id2558049"></a><p>
Samba-3 does not support nested groups from the MS Windows control environment.
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2558064"></a>Adding <span class="emphasis"><em>Domain Users</em></span> to the <span class="emphasis"><em>Power Users</em></span> Group</h3></div></div></div><p>“<span class="quote"><span class="emphasis"><em>
What must I do to add Domain Users to the Power Users group?
</em></span></span>”</p><a class="indexterm" name="id2558084"></a><p>
The Power Users group is a group that is local to each Windows 200x/XP Professional workstation.
You cannot add the Domain Users group to the Power Users group automatically, it must be done on
each workstation by logging in as the local workstation <span class="emphasis"><em>administrator</em></span> and
then using the following procedure:
</p><div class="procedure"><ol type="1"><li><p>
Click <span class="guimenu">Start -> Control Panel -> Users and Passwords</span>.
</p></li><li><p>
Click the <span class="guimenuitem">Advanced</span> tab.
</p></li><li><p>
Click the <span class="guibutton">Advanced</span> button.
</p></li><li><p>
Click <tt class="constant">Groups</tt>.
</p></li><li><p>
Double click <tt class="constant">Power Users</tt>. This will launch the panel to add users or groups
to the local machine <tt class="constant">Power Uses</tt> group.
</p></li><li><p>
Click the <span class="guibutton">Add</span> button.
</p></li><li><p>
Select the domain from which the <tt class="constant">Domain Users</tt> group is to be added.
</p></li><li><p>
Double click the <tt class="constant">Domain Users</tt> group.
</p></li><li><p>
Click the <span class="guibutton">Ok</span> button. If a logon box is presented during this process
please remember to enter the connect as <tt class="constant">DOMAIN\UserName</tt>. i.e., For the
domain <tt class="constant">MIDEARTH</tt> and the user <tt class="constant">root</tt> enter
<tt class="constant">MIDEARTH\root</tt>.
</p></li></ol></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="passdb.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="optional.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="idmapper.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter10.Account Information Databases</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">Chapter12.Identity Mapping (IDMAP)</td></tr></table></div></body></html>
|