1.5. Connecting to AD using POSIX attributes defined in Active Directory
AD can create and store POSIX attributes, such as uidNumber, gidNumber, unixHomeDirectory, or loginShell.
When using POSIX ID mapping, SSSD creates new UIDs and GIDs, which overrides the values defined in AD. To keep the AD-defined values, you must disable POSIX ID mapping in SSSD.
For best performance, publish the POSIX attributes to the AD global catalog. If POSIX attributes are not present in the global catalog, SSSD connects to the individual domain controllers directly on the LDAP port.
Prerequisites
Ensure that the required ports are open:
- Ensure that you are using the AD domain controller server for DNS.
- Verify that the system time on both systems is synchronized. This ensures that Kerberos is able to work correctly.
Procedure
Install the following packages:
# dnf install realmd oddjob oddjob-mkhomedir sssd adcli krb5-workstationConfigure the local RHEL system with POSIX ID mapping disabled using the
realm joincommand with the--automatic-id-mapping=nooption. Therealmdsuite edits all required configuration files automatically. For example, for a domain namedad.example.com:# realm join --automatic-id-mapping=no ad.example.comIf you already joined a domain, you can manually disable POSIX ID Mapping in SSSD:
-
Open the
/etc/sssd/sssd.conffile. -
In the AD domain section, add the
ldap_id_mapping = falsesetting. Remove the SSSD caches:
rm -f /var/lib/sss/db/*Restart SSSD:
systemctl restart sssdSSSD now uses POSIX attributes from AD, instead of creating them locally.
注意You must have the relevant POSIX attributes (
uidNumber,gidNumber,unixHomeDirectory, andloginShell) configured for the users in AD.-
Open the
Verification
Display an AD user details, such as the administrator user:
# getent passwd administrator@ad.example.com administrator@ad.example.com:*:10000:10000:Administrator:/home/Administrator:/bin/bash