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