1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
9 <title>User Rights and Privileges</title>
12 The administration of Windows user, group and machine accounts in the Samba
13 domain controlled network necessitates interfacing between the MS Windows
14 networking environment and the UNIX operating system environment. The right
15 (permission) to add machines to the Windows security domain can be assigned
16 (set) to non-administrative users both in Windows NT4 domains as well as in
17 Active Directory domains.
21 The addition of Windows NT4/2kX/XPPro machines to the domain necessitates the
22 creation of a machine account for each machine added. The machine account is
23 a necessity that is used to validate that the machine can be trusted to permit
28 Machine accounts are analogous to user accounts, and thus in implementing them
29 on a UNIX machine that is hosting Samba (i.e.: On which Samba is running) it is
30 necessary to create a special type of user account. Machine accounts differ from
31 a normal user account in that the account name (login ID) is terminated with a $
32 sign. An additional difference is that this type of account should not ever be able
33 to log into the UNIX environment as a system user and therefore is set to have a
34 shell of <command>/bin/false</command> and a home directory of
35 <command>/dev/null.</command>
39 The creation of UNIX system accounts has traditionally been the sole right of
40 the system administrator, better known as the <constant>root</constant> account.
41 It is possible in the UNIX environment to create multiple users who have the
42 same UID. Any UNIX user who has a UID=0 is inherently the same as the
43 <constant>root</constant> account.
47 All versions of Samba call system interface scripts that permit CIFS function
48 calls that are used to manage users, groups and machine accounts to be affected
49 in the UNIX environment. All versions of Samba up to and including version 3.0.10
50 required the use of a Windows Administrator account that unambiguously maps to
51 the UNIX <constant>root</constant> account to permit the execution of these
52 interface scripts. The reuqirement to do this has understandably met with some
53 disdain and consternation among Samba administrators, particularly where it became
54 necessary to permit people who should not posses <constant>root</constant> level
55 access to the UNIX host system.
59 <title>Rights Management Capabilities</title>
62 Samba 3.0.11 introduces support for the Windows privilege model. This model
63 allows certain rights to be assigned to a user or group SID. In order to enable
64 this feature, <smbconfoption name="enable privileges">yes</smbconfoption>
65 must be defined in the <smbconfsection name="global"/> section of the &smb.conf; file.
69 Currently, the rights supported in Samba 3 are listed in <link linkend="rp-privs"/>.
70 The remainder of this chapter explains how to manage and use these privileges on Samba servers.
74 <title>Current Privilege Capabilities</title>
76 <colspec align="right"/>
77 <colspec align="left"/>
80 <entry align="center">Privilege</entry>
81 <entry align="center">Description</entry>
86 <entry><para>SeMachineAccountPrivilege</para></entry>
87 <entry><para>Add machines to domain</para></entry>
90 <entry><para>SePrintOperatorPrivilege</para></entry>
91 <entry><para>Manage printers</para></entry>
94 <entry><para>SeAddUsersPrivilege</para></entry>
95 <entry><para>Add users and groups to the domain</para></entry>
98 <entry><para>SeRemoteShutdownPrivilege</para></entry>
99 <entry><para>Force shutdown from a remote system</para></entry>
102 <entry><para>SeDiskOperatorPrivilege</para></entry>
103 <entry><para>Manage disk share</para></entry>
110 <title>Using the <quote>net rpc rights</quote> Utility</title>
113 There are two primary means of managing the rights assigned to users and groups
114 on a Samba server. The <command>NT4 User Manager for Domains</command> may be
115 used from any Windows NT4, 2000 or XP Professional domain member client to
116 connect to a Samba domain controller and view/modify the rights assignments.
117 This application, however, appears to have bugs when run on a client running
118 Windows 2000 or later, therefore Samba provides a command line utility for
119 performing the necessary administrative actions.
123 The <command>net rpc rights</command> utility in Samba 3.0.11 has 3 new subcommands:
127 <varlistentry><term>list [name|accounts]</term>
129 When called with no arguments, <command>net rpc list</command>
130 will simply list the available rights on the server. When passed
131 a specific user or group name, the tool lists the privileges
132 currently assigned to the specified account. When invoked using
133 the special string <constant>accounts</constant>,
134 <command>net rpc rights list</command> will return a list of all
135 privileged accounts on the server and the assigned rights.
139 <varlistentry><term>grant <user> <right [right ...]></term>
141 When called with no arguments, This function is used to assign
142 a list of rights to a specified user or group. For example,
143 to grant the members of the Domain Admins group on a Samba DC
144 the capability to add client machines to the domain, one would run:
146 &rootprompt; net -S server -U domadmin rpc rights grant \
147 'DOMAIN\Domain Admins' SeMachineAccountPrivilege
149 More than one privilege can be assigned by specifying a
150 list of rights separated by spaces. The parameter 'Domain\Domain Admins'
151 must be quoted with single ticks or using double-quotes to prevent
152 the back-slash and the space from being interpreted by the system shell.
156 <varlistentry><term>revoke <user> <right [right ...]></term>
158 This command is similar in format to <command>net rpc rights grant</command>. It's
159 effect is to remove an assigned right (or list of rights) from a user or group.
166 You must be connected as a member of the Domain Admins group to be able to
167 grant or revoke privileges assigned to an account. This capability is
168 inherent to the Domain Admins group and is not configurable.
172 By default, no privileges are initially assigned to any
173 account. The reason for this is that certain actions will
174 be performed as root once smbd determines that a user has
175 the necessary rights. For example, when joining a client to
176 a Windows domain, the 'add machine script' must be executed
177 with superuser rights in most cases. For this reason, you
178 should be very careful about handing out privileges to
183 Access as the root user (UID=0) bypasses all privilege checks.
189 <title>Description of Privileges</title>
192 The privileges that have been implemented in Samba-3.0.11 are shown below.
193 It is possible, and likely, that additional privileges may be implemented in
194 later releases of Samba. It is also likely that any privileges currently implemented
195 but not used may be removed from future releases, thus it is important that
196 the successful as well as unsuccessful use of these facilities should be reported
197 on the Samba mailing lists.
201 <varlistentry><term>SeAddUsersPrivilege</term>
203 This right determines whether or not smbd will allow the
204 user to create new user or group accounts via such tools
205 as <command>net rpc user add</command> or
206 <command>NT4 User Manager for Domains.</command>
210 <varlistentry><term>SeDiskOperatorPrivilege</term>
212 Accounts which posses this right will be able to execute
213 scripts defined by the <command>add/delete/change</command>
214 share command in &smb.conf; file as root. Such users will
215 also be able to modify the ACL associated with file shares
220 <varlistentry><term>SeMachineAccountPrivilege</term>
222 Controls whether or not the user is able join client
223 machines to a Samba controlled domain.
227 <varlistentry><term>SePrintOperatorPrivilege</term>
229 This privilege operates identically to the
230 <smbconfoption name="printer admin"/>
231 option in the &smb.conf; file (see section 5 man page for &smb.conf;)
232 except that it is a global right (not on a per printer basis).
233 Eventually the smb.conf option will be deprecated and administrative
234 rights to printers will be controlled exclusively by this right and
235 the security descriptor associated with the printer object in the
236 <filename>ntprinters.tdb</filename> file.
240 <varlistentry><term>SeRemoteShutdownPrivilege</term>
242 Samba provides two hooks for shutting down or rebooting
243 the server and for aborting a previously issued shutdown
244 command. Since this is an operation normally limited by
245 the operating system to the root user, an account must possess this
246 right to be able to execute either of these hooks to have any effect.
257 <title>The Administrator Domain SID</title>
260 Please note that when configured as a DC, it is now required
261 that an account in the server's passdb backend be set to the
262 domain SID of the default Administrator account. To obtain the
263 domain SID on a Samba DC, run the following command:
266 &rootprompt; net getlocalsid
267 SID for domain FOO is: S-1-5-21-4294955119-3368514841-2087710299
269 You may assign the Domain Administrator rid to an account using the <command>pdbedit</command>
270 command as shown here:
272 &rootprompt; pdbedit -U S-1-5-21-4294955119-3368514841-2087710299-500 -u root -r