Questo contenuto non è disponibile nella lingua selezionata.
Chapter 2. Connecting RHEL systems directly to AD using Samba Winbind
To connect a RHEL system to Active Directory (AD), use:
- Samba Winbind to interact with the AD identity and authentication source
-
realmdto detect available domains and configure the underlying RHEL system services.
2.1. Overview of direct integration using Samba Winbind Copia collegamentoCollegamento copiato negli appunti!
Samba Winbind emulates a Windows client on a Linux system and communicates with AD servers.
You can use the realmd service to configure Samba Winbind by:
- Configuring network authentication and domain membership in a standard way.
- Automatically discovering information about accessible domains and realms.
- Not requiring advanced configuration to join a domain or realm.
Note that:
- Direct integration with Winbind in a multi-forest AD setup requires bidirectional trusts.
-
Remote forests must trust the local forest to ensure that the
idmap_adplug-in handles remote forest users correctly.
Samba’s winbindd service provides an interface for the Name Service Switch (NSS) and enables domain users to authenticate to AD when logging into the local system.
Using winbindd provides the benefit that you can enhance the configuration to share directories and printers without installing additional software.
2.2. Supported Windows platforms for direct integration Copia collegamentoCollegamento copiato negli appunti!
You can directly integrate your RHEL system with Active Directory forests that use the following forest and domain functional levels:
- Forest functional level range: Windows Server 2008 - Windows Server 2016
- Domain functional level range: Windows Server 2008 - Windows Server 2016
Direct integration has been tested on the following supported operating systems:
- Windows Server 2022 (RHEL 8.7 or later)
- Windows Server 2019
- Windows Server 2016
- Windows Server 2012 R2
Windows Server 2019 and Windows Server 2022 do not introduce a new functional level. The highest functional level Windows Server 2019 and Windows Server 2022 use is Windows Server 2016.
2.3. Joining a RHEL system to an AD domain Copia collegamentoCollegamento copiato negli appunti!
Samba Winbind is an alternative to the System Security Services Daemon (SSSD) for connecting a Red Hat Enterprise Linux (RHEL) system with Active Directory (AD). You can join a RHEL system to an AD domain by using realmd to configure Samba Winbind.
Prerequisites
- The host uses a DNS server that can resolve the AD domain.
- The time on the host is synchronized with the time in AD and the time zone settings are correct.
Procedure
If your AD requires the deprecated RC4 encryption type for Kerberos authentication, enable support for these ciphers in RHEL:
update-crypto-policies --set DEFAULT:AD-SUPPORT
# update-crypto-policies --set DEFAULT:AD-SUPPORTCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install the following packages:
yum install realmd oddjob-mkhomedir oddjob samba-winbind-clients \ samba-winbind samba-common-tools samba-winbind-krb5-locator krb5-workstation# yum install realmd oddjob-mkhomedir oddjob samba-winbind-clients \ samba-winbind samba-common-tools samba-winbind-krb5-locator krb5-workstationCopy to Clipboard Copied! Toggle word wrap Toggle overflow To share directories or printers on the domain member, install the
sambapackage:yum install samba
# yum install sambaCopy to Clipboard Copied! Toggle word wrap Toggle overflow Backup the existing
/etc/samba/smb.confSamba configuration file:mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
# mv /etc/samba/smb.conf /etc/samba/smb.conf.bakCopy to Clipboard Copied! Toggle word wrap Toggle overflow Join the domain. For example, to join a domain named
ad.example.com:realm join --membership-software=samba --client-software=winbind ad.example.com
# realm join --membership-software=samba --client-software=winbind ad.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow Using the previous command, the
realmutility automatically:-
Creates a
/etc/samba/smb.conffile for a membership in thead.example.comdomain -
Adds the
winbindmodule for user and group lookups to the/etc/nsswitch.conffile -
Updates the Pluggable Authentication Module (PAM) configuration files in the
/etc/pam.d/directory -
Starts the
winbindservice and enables the service to start when the system boots
-
Creates a
Optional: Set an alternative ID mapping back end or customized ID mapping settings in the
/etc/samba/smb.conffile.For details, see the Understanding and configuring Samba ID mapping
Edit the
/etc/krb5.conffile and add the following section:[plugins] localauth = { module = winbind:/usr/lib64/samba/krb5/winbind_krb5_localauth.so enable_only = winbind }[plugins] localauth = { module = winbind:/usr/lib64/samba/krb5/winbind_krb5_localauth.so enable_only = winbind }Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
winbindservice is running:systemctl status winbind ... Active: active (running) since Tue 2018-11-06 19:10:40 CET; 15s ago
# systemctl status winbind ... Active: active (running) since Tue 2018-11-06 19:10:40 CET; 15s agoCopy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantTo enable Samba to query domain user and group information, the
winbindservice must be running before you startsmb.If you installed the
sambapackage to share directories and printers, enable and start thesmbservice:systemctl enable --now smb
# systemctl enable --now smbCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Display an AD user’s details, such as the AD administrator account in the AD domain:
getent passwd "AD\administrator" AD\administrator:*:10000:10000::/home/administrator@AD:/bin/bash
# getent passwd "AD\administrator" AD\administrator:*:10000:10000::/home/administrator@AD:/bin/bashCopy to Clipboard Copied! Toggle word wrap Toggle overflow Query the members of the domain users group in the AD domain:
getent group "AD\Domain Users" AD\domain users:x:10000:user1,user2# getent group "AD\Domain Users" AD\domain users:x:10000:user1,user2Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Verify that you can use domain users and groups when you set permissions on files and directories. For example, to set the owner of the
/srv/samba/example.txtfile toAD\administratorand the group toAD\Domain Users:chown "AD\administrator":"AD\Domain Users" /srv/samba/example.txt
# chown "AD\administrator":"AD\Domain Users" /srv/samba/example.txtCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that Kerberos authentication works as expected:
On the AD domain member, obtain a ticket for the
administrator@AD.EXAMPLE.COMprincipal:kinit administrator@AD.EXAMPLE.COM
# kinit administrator@AD.EXAMPLE.COMCopy to Clipboard Copied! Toggle word wrap Toggle overflow Display the cached Kerberos ticket:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Display the available domains:
wbinfo --all-domains BUILTIN SAMBA-SERVER AD
# wbinfo --all-domains BUILTIN SAMBA-SERVER ADCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.4. realm commands Copia collegamentoCollegamento copiato negli appunti!
The realmd system has two major task areas:
- Managing system enrollment in a domain.
- Controlling which domain users are allowed to access local system resources.
In realmd use the command line tool realm to run commands. Most realm commands require the user to specify the action that the utility should perform, and the entity, such as a domain or user account, for which to perform the action.
| Command | Description |
|---|---|
| Realm Commands | |
| discover | Run a discovery scan for domains on the network. |
| join | Add the system to the specified domain. |
| leave | Remove the system from the specified domain. |
| list | List all configured domains for the system or all discovered and configured domains. |
| Login Commands | |
| permit | Enable access for specific users or for all users within a configured domain to access the local system. |
| deny | Restrict access for specific users or for all users within a configured domain to access the local system. |