From 293421f3c64a2adff7dc15f7ad3adb6120c9fd16 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 24 Sep 2003 15:05:22 +0000 Subject: syncing up docs, examples, & packaging from 3.0 (This used to be commit dd1348c566b4700ea01bd89639e2d3330c878167) --- docs/htmldocs/groupmapping.html | 278 ++++++++++++++++++++++++---------------- 1 file changed, 166 insertions(+), 112 deletions(-) (limited to 'docs/htmldocs/groupmapping.html') diff --git a/docs/htmldocs/groupmapping.html b/docs/htmldocs/groupmapping.html index 39d317e8cf..da8cf8f4b1 100644 --- a/docs/htmldocs/groupmapping.html +++ b/docs/htmldocs/groupmapping.html @@ -1,119 +1,164 @@ -Chapter 12. Mapping MS Windows and UNIX Groups

Chapter 12. Mapping MS Windows and UNIX Groups

Jean François Micouleau

Gerald (Jerry) Carter

Samba Team

John H. Terpstra

Samba Team

+Chapter 12. Group Mapping MS Windows and UNIX

Chapter 12. Group Mapping MS Windows and UNIX

John H. Terpstra

Samba Team

Jean François Micouleau

Gerald (Jerry) Carter

Samba Team

+ Starting with Samba-3, new group mapping functionality is available to create associations between Windows group SIDs and UNIX groups. The groupmap subcommand included with the net tool can be used to manage these associations. +

+ 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 (-1) will be exposed + in group selection lists in tools that access domain users and groups.

Warning

- The first immediate reason to use the group mapping on a Samba PDC, is that - - the domain admin group has been removed and should no longer - be specified in smb.conf. This parameter was used to give the listed users membership - in the Domain Admins Windows group which gave local admin rights on their workstations + + The domain admin group parameter has been removed in Samba-3 and should no longer + be specified in smb.conf. This parameter was used to give the listed users membership in the + Domain Admins Windows group which gave local admin rights on their workstations (in default configurations). -

Features and Benefits

- Samba allows the administrator to create MS Windows NT4 / 200x group accounts and to +

Features and Benefits

+ Samba allows the administrator to create MS Windows NT4/200x group accounts and to arbitrarily associate them with UNIX/Linux group accounts. -

- 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 smb.conf if it is desired that UNIX / Linux system +

+ + + 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 smb.conf 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 winbind is running, Samba accounts group accounts that are created using these tools will be - allocated UNIX UIDs/GIDs from the parameters set by the idmap uid/idmap gid settings - in the smb.conf file. -

Figure 12.1. IDMAP groups

IDMAP groups

+ so long as winbindd is running, Samba group accounts that are created using these + tools will be allocated UNIX UIDs/GIDs from the ID range specified by the + idmap uid/idmap gid + parameters in the smb.conf file. +

Figure 12.1. IDMAP: group SID to GID resolution.

IDMAP: group SID to GID resolution.

Figure 12.2. IDMAP: GID resolution to matching SID.

IDMAP: GID resolution to matching SID.

+ In both cases, when winbindd is not running, only locally resolvable groups can be recognized. Please refer to + and . The net groupmap is + used to establish UNIX group to NT SID mappings as shown in . +

Figure 12.3. IDMAP storing group mappings.

IDMAP storing group mappings.

+ + Administrators should be aware that where smb.conf group interface scripts make - direct calls to the UNIX/Linux system tools (eg: the shadow utilities, groupadd, - groupdel, groupmod) then 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 + direct calls to the UNIX/Linux system tools (the shadow utilities, groupadd, + groupdel, and groupmod), 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 Engineering Managers will attempt to create an identically named - UNIX/Linux group, an attempt that will of course fail! -

+ UNIX/Linux group, an attempt that will of course fail. +

+ + 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) + 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.

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 net groupmap + MS Windows NT4/200x group on the Samba server and then use the net groupmap tool to connect the two to each other. -

Discussion

- When installing MS Windows NT4 / 200x on a computer, the installation +

Discussion

+ When installing MS Windows NT4/200x on a computer, the installation program creates default users and groups, notably the Administrators group, - and gives that group privileges necessary privileges to perform essential system tasks. - eg: Ability to change the date and time or to kill (or close) any process running on the + 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. -

- The 'Administrator' user is a member of the 'Administrators' group, and thus inherits - 'Administrators' group privileges. If a 'joe' user is created to be a member of the - 'Administrator' group, 'joe' has exactly the same rights as 'Administrator'.

- When an MS Windows NT4 / W200x is made a domain member, the "Domain Admins" group of the - PDC is added to the local 'Administrators' group of the workstation. Every member of the - 'Domain Administrators' group inherits the rights of the local 'Administrators' group when + + The Administrator user is a member of the Administrators group, and thus inherits + Administrators group privileges. If a joe user is created to be a member of the + Administrators group, joe has exactly the same rights as the user, + Administrator. +

+ When an MS Windows NT4/200x/XP machine is made a Domain Member, the “Domain Admins” group of the + PDC is added to the local Administrators group of the workstation. Every member of the + Domain Administrators group inherits the rights of the local Administrators group when logging on the workstation.

- The following steps describe how to make Samba PDC users members of the 'Domain Admins' group? + The following steps describe how to make Samba PDC users members of the Domain Admins group?

  1. - create a unix group (usually in /etc/group), let's call it domadm -

  2. add to this group the users that must be Administrators. For example - if you want joe, john and mary, your entry in /etc/group will - look like: + Create a UNIX group (usually in /etc/group), let's call it domadm. +

  3. + Add to this group the users that must be “Administrators”. For example, + if you want joe, john and mary to be administrators, + your entry in /etc/group will look like this:

     		domadm:x:502:joe,john,mary
     		

  4. - Map this domadm group to the "Domain Admins" group by running the command: + Map this domadm group to the “Domain Admins” group by running the command:

    -

    -root# net groupmap add ntgroup="Domain Admins" unixgroup=domadm
    -

    -

    - The quotes around "Domain Admins" are necessary due to the space in the group name. - Also make sure to leave no whitespace surrounding the equal character (=). +

    +	root# net groupmap add ntgroup=“Domain Admins” UNIXgroup=domadm
    +	

    +

    + + The quotes around “Domain Admins” are necessary due to the space in the group name. + Also make sure to leave no white-space surrounding the equal character (=).

- Now joe, john and mary are domain administrators! -

- 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 a ACL on a local file or printer on a domain member machine, + Now joe, john and mary are domain administrators. +

+ + 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:

-root# net groupmap add rid=1000 ntgroup="Accounting" unixgroup=acct
+root# net groupmap add rid=1000 ntgroup="Accounting" UNIXgroup=acct
 

- 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. Verifying this is done differently depending on the passdb backend - you are using. Future versions of the tools may perform the verification automatically, + 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. -

Example Configuration

- You can list the various groups in the mapping database by executing - net groupmap list. Here is an example: -

+

Default Users, Groups and Relative Identifiers

+ + + When first installed, Microsoft Windows NT4/200x/XP are preconfigured 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 tdbsam the essential + Domain Groups are automatically created. It is the LDAP administrators' responsibility to create + (provision) the default NT Groups. +

+ Each essential Domain Group must be assigned its respective well-kown RID. The default Users, Groups, + Aliases, and RIDs are shown in . +

Note

+ When the passdb backend uses LDAP (ldapsam) it is the + admininstrators' responsibility to create the essential Domain Groups, and to assign each its default RID. +

+ 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. +

+ 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. +

+

Table 12.1. Well-Known User Default RIDs

Well-Known EntityRIDTypeEssential
Domain Administrator500UserNo
Domain Guest501UserNo
Domain KRBTGT502UserNo
Domain Admins512GroupYes
Domain Users513GroupYes
Domain Guests514GroupYes
Domain Computers515GroupNo
Domain Controllers516GroupNo
Domain Certificate Admins517GroupNo
Domain Schema Admins518GroupNo
Domain Enterprise Admins519GroupNo
Domain Policy Admins520GroupNo
Builtin Admins544AliasNo
Builtin users545AliasNo
Builtin Guests546AliasNo
Builtin Power Users547AliasNo
Builtin Account Operators548AliasNo
Builtin System Operators549AliasNo
Builtin Print Operators550AliasNo
Builtin Backup Operators551AliasNo
Builtin Replicator552AliasNo
Builtin RAS Servers553AliasNo

+

Example Configuration

+ You can list the various groups in the mapping database by executing + net groupmap list. Here is an example: +

 root#  net groupmap list
-System Administrators (S-1-5-21-2547222302-1596225915-2414751004-1002) -> sysadmin
 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
 

For complete details on net groupmap, refer to the net(8) man page. -

Configuration Scripts

+

Configuration Scripts

Everyone needs tools. Some of us like to create our own, others prefer to use canned tools - (ie: prepared by someone else for general use). -

Sample smb.conf add group script

- A script to create complying group names for use by the Samba group interfaces: -

-

Example 12.1. smbgrpadd.sh

+	(i.e., prepared by someone else for general use). 
+	

Sample smb.conf Add Group Script

+ A script to create complying group names for use by the Samba group interfaces + is provided in . +

+

Example 12.1. smbgrpadd.sh

 
 #!/bin/bash
 
 # Add the group using normal system groupadd tool.
 groupadd smbtmpgrp00
 
-thegid=`cat /etc/group | grep smbtmpgrp00 | cut -d ":" -f3`
+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
@@ -124,73 +169,82 @@ echo $thegid
 exit 0
 

- The smb.conf entry for the above script would look like: -

add group script = /path_to_tool/smbgrpadd.sh %g

-

Script to configure Group Mapping

+ The smb.conf entry for the above script would be something like that in . +

Example 12.2. Configuration of smb.conf for the add group script.

[global]
...
add group script = /path_to_tool/smbgrpadd.sh %g
...

+

Script to Configure Group Mapping

In our example we have created a UNIX/Linux group called ntadmin. - Our script will create the additional groups Orks, Elves, Gnomes: + Our script will create the additional groups Orks, Elves, and Gnomes. + 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 concenience we elect to save this script as a file called initGroups.sh. + This script is given in .

-

+
+

Example 12.3. Script to Set Group Mapping

 #!/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
-net groupmap modify ntgroup="Administrators" unixgroup=root
-net groupmap modify ntgroup="Users" unixgroup=users
-net groupmap modify ntgroup="Guests" unixgroup=nobody
-net groupmap modify ntgroup="System Operators" unixgroup=sys
-net groupmap modify ntgroup="Account Operators" unixgroup=root
-net groupmap modify ntgroup="Backup Operators" unixgroup=bin
-net groupmap modify ntgroup="Print Operators" unixgroup=lp
-net groupmap modify ntgroup="Replicators" unixgroup=daemon
-net groupmap modify ntgroup="Power Users" unixgroup=sys
+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
-

+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 +

Of course it is expected that the administrator will modify this to suit local needs. For information regarding the use of the net groupmap tool please refer to the man page. -

Common Errors

+

Common Errors

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. -

Adding Groups Fails

+

Adding Groups Fails

This is a common problem when the groupadd is called directly - by the Samba interface script for the add group script in + by the Samba interface script for the add group script in the smb.conf file.

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.

- There are three possible work-arounds. Firstly, use only group names that comply + There are three possible work-arounds. First, use only group names that comply with the limitations of the UNIX/Linux groupadd system tool. - The second involves use of the script mentioned earlier in this chapter, and the - third option is to manually create a UNIX/Linux group account that can substitute + 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. -

Adding MS Windows Groups to MS Windows Groups Fails

- Samba-3 does NOT support nested groups from the MS Windows control environment. -

Adding Domain Users to the Power Users group

+

Adding MS Windows Groups to MS Windows Groups Fails

+ Samba-3 does not support nested groups from the MS Windows control environment. +

Adding Domain Users to the Power Users Group

What must I do to add Domain Users to the Power Users group? -

- The Power Users group is a group that is local to each Windows - 200x / XP Professional workstation. You can not add the Domain Users group to the Power Users - group automatically, this must be done on each workstation by logging in as the local workstation - administrator and then using click on Start / Control Panel / Users and Passwords - now click on the 'Advanced' tab, then on the 'Advanced' Button. -

- Now click on 'Groups', then double click on 'Power Users'. This will launch the panel to add users - or groups to the local machine 'Power Uses' group. Click on the 'Add' button, select the domain - from which the 'Domain Users' group is to be added, double click on the 'Domain Users' group, then - click on the 'Ok' button. Note: If a logon box is presented during this process please remember to - enter the connect as DOMAIN\UserName. ie: For the domain MIDEARTH and the user 'root' enter - MIDEARTH\root. -

+ ”

+ 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 administrator and + then using the following procedure: +

  1. + Click Start -> Control Panel -> Users and Passwords. +

  2. + Click the Advanced tab. +

  3. + Click the Advanced button. +

  4. + Click Groups. +

  5. + Double click Power Users. This will launch the panel to add users or groups + to the local machine Power Uses group. +

  6. + Click the Add button. +

  7. + Select the domain from which the Domain Users group is to be added. +

  8. + Double click the Domain Users group. +

  9. + Click the Ok button. If a logon box is presented during this process + please remember to enter the connect as DOMAIN\UserName. i.e., For the + domain MIDEARTH and the user root enter + MIDEARTH\root. +

-- cgit