22.6.3. Domain Controller
A domain controller in Windows NT is functionally similar to a Network Information Service (NIS) server in a Linux environment. Domain controllers and NIS servers both host user/group information databases as well as related services. Domain controllers are mainly used for security, including the authentication of users accessing domain resources. The service that maintains the user/group database integrity is called the Security Account Manager (SAM). The SAM database is stored differently between Windows and Linux Samba-based systems, therefore SAM replication cannot be achieved and platforms cannot be mixed in a PDC/BDC environment.
In a Samba environment, there can be only one PDC and zero or more BDCs.
Important
Samba cannot exist in a mixed Samba/Windows domain controller environment (Samba cannot be a BDC of a Windows PDC or vice versa). Alternatively, Samba PDCs and BDCs can coexist.
22.6.3.1. Primary Domain Controller (PDC) using tdbsam Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
The simplest and most common implementation of a Samba PDC uses the
tdbsam
password database backend. Planned to replace the aging smbpasswd
backend, tdbsam
has numerous improvements that are explained in more detail in Section 22.8, “Samba Account Information Databases”. The passdb backend
directive controls which backend is to be used for the PDC.
To provide a functional PDC system which uses the
tdbsam
follow these steps:
- Use a configuration of the
smb.conf
file as shown in the example above. - Add the root user to the Samba password database.
smbpasswd -a root Provide the password here.
smbpasswd -a root Provide the password here.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Start the
smb
service. - Make sure all profile, user, and netlogon directories are created.
- Add groups that users can be members of.
groupadd -f users groupadd -f nobody groupadd -f ntadmins
groupadd -f users groupadd -f nobody groupadd -f ntadmins
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Associate the UNIX groups with their respective Windows groups.
net groupmap add ntgroup="Domain Users" unixgroup=users net groupmap add ntgroup="Domain Guests" unixgroup=nobody net groupmap add ntgroup="Domain Admins" unixgroup=ntadmins
net groupmap add ntgroup="Domain Users" unixgroup=users net groupmap add ntgroup="Domain Guests" unixgroup=nobody net groupmap add ntgroup="Domain Admins" unixgroup=ntadmins
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Grant access rights to a user or a group. For example, to grant the right to add client machines to the domain on a Samba domain controller, to the members to the Domain Admins group, execute the following command:
net rpc rights grant 'DOCS\Domain Admins' SetMachineAccountPrivilege -S PDC -U root
net rpc rights grant 'DOCS\Domain Admins' SetMachineAccountPrivilege -S PDC -U root
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Keep in mind that Windows systems prefer to have a primary group which is mapped to a domain group such as Domain Users.
Windows groups and users use the same namespace thus not allowing the existence of a group and a user with the same name like in UNIX.
Note
If you need more than one domain controller or have more than 250 users, do not use a
tdbsam
authentication backend. LDAP is recommended in these cases.