&author.jerry; &author.jht; User Rights and Privileges The administration of Windows user, group, and machine accounts in the Samba domain-controlled network necessitates interfacing between the MS Windows networking environment and the UNIX operating system environment. The right (permission) to add machines to the Windows security domain can be assigned (set) to non-administrative users both in Windows NT4 domains and Active Directory domains. The addition of Windows NT4/2kX/XPPro machines to the domain necessitates the creation of a machine account for each machine added. The machine account is a necessity that is used to validate that the machine can be trusted to permit user logons. Machine accounts are analogous to user accounts, and thus in implementing them on a UNIX machine that is hosting Samba (i.e., on which Samba is running) it is necessary to create a special type of user account. Machine accounts differ from a normal user account in that the account name (login ID) is terminated with a $ sign. An additional difference is that this type of account should not ever be able to log into the UNIX environment as a system user and therefore is set to have a shell of /bin/false and a home directory of /dev/null. The creation of UNIX system accounts has traditionally been the sole right of the system administrator, better known as the root account. It is possible in the UNIX environment to create multiple users who have the same UID. Any UNIX user who has a UID=0 is inherently the same as the root account. All versions of Samba call system interface scripts that permit CIFS function calls that are used to manage users, groups, and machine accounts in the UNIX environment. All versions of Samba up to and including version 3.0.10 required the use of a Windows administrator account that unambiguously maps to the UNIX root account to permit the execution of these interface scripts. The requirement to do this has understandably met with some disdain and consternation among Samba administrators, particularly where it became necessary to permit people who should not possess root-level access to the UNIX host system. Rights Management Capabilities Samba 3.0.11 introduces support for the Windows privilege model. This model allows certain rights to be assigned to a user or group SID. In order to enable this feature, yes must be defined in the section of the &smb.conf; file. Currently, the rights supported in Samba-3 are listed in . The remainder of this chapter explains how to manage and use these privileges on Samba servers. Current Privilege Capabilities Privilege Description SeMachineAccountPrivilege Add machines to domain SePrintOperatorPrivilege Manage printers SeAddUsersPrivilege Add users and groups to the domain SeRemoteShutdownPrivilege Force shutdown from a remote system SeDiskOperatorPrivilege Manage disk share
Using the <quote>net rpc rights</quote> Utility There are two primary means of managing the rights assigned to users and groups on a Samba server. The NT4 User Manager for Domains may be used from any Windows NT4, 2000, or XP Professional domain member client to connect to a Samba domain controller and view/modify the rights assignments. This application, however, appears to have bugs when run on a client running Windows 2000 or later; therefore, Samba provides a command-line utility for performing the necessary administrative actions. The net rpc rights utility in Samba 3.0.11 has three new subcommands: list [name|accounts] When called with no arguments, net rpc list simply lists the available rights on the server. When passed a specific user or group name, the tool lists the privileges currently assigned to the specified account. When invoked using the special string accounts, net rpc rights list returns a list of all privileged accounts on the server and the assigned rights. grant <user> <right [right ...]> When called with no arguments, this function is used to assign a list of rights to a specified user or group. For example, to grant the members of the Domain Admins group on a Samba domain controller, the capability to add client machines to the domain, one would run: &rootprompt; net -S server -U domadmin rpc rights grant \ 'DOMAIN\Domain Admins' SeMachineAccountPrivilege More than one privilege can be assigned by specifying a list of rights separated by spaces. The parameter 'Domain\Domain Admins' must be quoted with single ticks or using double-quotes to prevent the backslash and the space from being interpreted by the system shell. revoke <user> <right [right ...]> This command is similar in format to net rpc rights grant. Its effect is to remove an assigned right (or list of rights) from a user or group. You must be connected as a member of the Domain Admins group to be able to grant or revoke privileges assigned to an account. This capability is inherent to the Domain Admins group and is not configurable. By default, no privileges are initially assigned to any account because certain actions will be performed as root once smbd determines that a user has the necessary rights. For example, when joining a client to a Windows domain, the `add machine script' must be executed with superuser rights in most cases. For this reason, you should be very careful about handing out privileges to accounts. Access as the root user (UID=0) bypasses all privilege checks. Description of Privileges The privileges that have been implemented in Samba-3.0.11 are shown below. It is possible, and likely, that additional privileges may be implemented in later releases of Samba. It is also likely that any privileges currently implemented but not used may be removed from future releases, so it is important that the successful as well as unsuccessful use of these facilities should be reported on the Samba mailing lists. SeAddUsersPrivilege This right determines whether or not smbd will allow the user to create new user or group accounts via such tools as net rpc user add or NT4 User Manager for Domains. SeDiskOperatorPrivilege Accounts that possess this right will be able to execute scripts defined by the add/delete/change share command in &smb.conf; file as root. Such users will also be able to modify the ACL associated with file shares on the Samba server. SeMachineAccountPrivilege Controls whether or not the user can join client machines to a Samba-controlled domain. SePrintOperatorPrivilege This privilege operates identically to the option in the &smb.conf; file (see section 5 man page for &smb.conf;) except that it is a global right (not on a per-printer basis). Eventually the smb.conf option will be deprecated and administrative rights to printers will be controlled exclusively by this right and the security descriptor associated with the printer object in the ntprinters.tdb file. SeRemoteShutdownPrivilege Samba provides two hooks for shutting down or rebooting the server and for aborting a previously issued shutdown command. Since this is an operation normally limited by the operating system to the root user, an account must possess this right to be able to execute either of these hooks.
The Administrator Domain SID Please note that every Windows NT4 and later server requires a domain Adminsitrator account. Samba version commencing with 3.0.11 permit the Administrative duties to be performed via assigned rights and privileges (see User Rights and Privileges). An account in the server's passdb backend can be set to the domain SID of the default administrator account. To obtain the domain SID on a Samba domain controller, run the following command: &rootprompt; net getlocalsid SID for domain FOO is: S-1-5-21-4294955119-3368514841-2087710299 You may assign the domain administrator RID to an account using the pdbedit command as shown here: &rootprompt; pdbedit -U S-1-5-21-4294955119-3368514841-2087710299-500 -u root -r The RID 500 is the well known standard value of the default Administrator account. It is the RID that confers the rights and privileges that the Administrator account has on a Windows machine or domain. Under UNIX/Linux the equivalent is UID=0 (the root account). Commencing with Samba version 3.0.11 it is possible to operate without an Administrator account providing equivalent rights and privileges have been established for a Windows user or a Windows group account.