This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.
[ira/wip.git] / docs / docbook / projdoc / GROUP-MAPPING-HOWTO.xml
1 <?xml version="1.0" encoding="iso8859-1"?>
2 <chapter id="groupmapping">
3 <chapterinfo>
4         <author>
5                 <firstname>Jean François</firstname><surname>Micouleau</surname>
6         </author>
7         &author.jerry;
8 </chapterinfo>
9
10 <title>Configuring Group Mapping</title>
11
12 <para>
13 Starting with Samba 3.0 alpha 2, new group mapping functionality
14 is available to create associations between Windows SIDs and UNIX
15 groups. The <parameter>groupmap</parameter> subcommand included with
16 the <command>net</command> tool can be used to manage these associations.
17 </para>
18
19 <para>
20 The first immediate reason to use the group mapping on a Samba PDC, is that
21 the <parameter>domain admin group</parameter> &smb.conf; has been removed.
22 This parameter was used to give the listed users membership in the "Domain Admins"
23 Windows group which gave local admin rights on their workstations (in
24 default configurations).
25 </para>
26
27 <para>
28 When installing NT/W2K on a computer, the installer program creates some users
29 and groups. Notably the 'Administrators' group, and gives to that group some
30 privileges like the ability to change the date and time or to kill any process
31 (or close too) running on the local machine. The 'Administrator' user is a
32 member of the 'Administrators' group, and thus 'inherit' the 'Administrators'
33 group privileges. If a 'joe' user is created and become a member of the
34 'Administrator' group, 'joe' has exactly the same rights as 'Administrator'.
35 </para>
36
37 <para>
38 When a NT/W2K machine is joined to a domain, the "Domain Adminis" group of the
39 PDC is added to the local 'Administrators' group of the workstation. Every
40 member of the 'Domain Administrators' group 'inherit' the
41 rights of the local 'Administrators' group when logging on the workstation.
42 </para>
43
44 <para>
45 The following steps describe how to make samba PDC users members of the
46 'Domain Admins' group?
47 </para>
48
49 <orderedlist>
50 <listitem><para>create a unix group (usually in <filename>/etc/group</filename>),
51   let's call it domadm</para></listitem>
52 <listitem><para>add to this group the users that must be Administrators. For example
53   if you want joe,john and mary, your entry in <filename>/etc/group</filename> will
54   look like:</para>
55
56   <para><programlisting>
57   domadm:x:502:joe,john,mary
58   </programlisting></para>
59
60   </listitem>
61
62 <listitem><para>Map this domadm group to the "Domain Admins" group
63   by running the command:</para>
64
65   <para><prompt>root# </prompt><userinput>net groupmap add ntgroup="Domain Admins" unixgroup=domadm</userinput></para>
66   
67   <para>The quotes around "Domain Admins" are necessary due to the space in the group name.  Also make
68   sure to leave no whitespace surrounding the equal character (=).</para>
69   </listitem>
70
71 </orderedlist>
72
73 <para>Now joe, john and mary are domain administrators!</para>
74
75 <para>
76 It is possible to map any arbitrary UNIX group to any Windows NT
77 group as well as making any UNIX group a Windows domain group.
78 For example, if you wanted to include a UNIX group (e.g. acct) in a ACL on a
79 local file or printer on a domain member machine, you would flag
80 that group as a domain group by running the following on the Samba PDC:
81 </para>
82
83 <para><prompt>root# </prompt><userinput>net groupmap add rid=1000 ntgroup="Accounting" unixgroup=acct</userinput></para>
84
85 <para>Be aware that the rid parmeter is a unsigned 32 bit integer that should
86 normally start at 1000.  However, this rid must not overlap with any RID assigned
87 to a user.  Verifying this is done differently depending on on the passdb backend 
88 you are using.  Future versions of the tools may perform the verification automatically,
89 but for now the burden in on you.</para>
90
91 <para>You can list the various groups in the mapping database by executing 
92 <command>net groupmap list</command>.  Here is an example:</para>
93
94 <para><programlisting><prompt>root# </prompt>net groupmap list
95 System Administrators (S-1-5-21-2547222302-1596225915-2414751004-1002) -> sysadmin
96 Domain Admins (S-1-5-21-2547222302-1596225915-2414751004-512) -> domadmin
97 Domain Users (S-1-5-21-2547222302-1596225915-2414751004-513) -> domuser
98 Domain Guests (S-1-5-21-2547222302-1596225915-2414751004-514) -> domguest
99 </programlisting></para>
100
101 <para>For complete details on <command>net groupmap</command>, refer to the 
102 net(8) man page.</para>
103
104 </chapter>