Questo contenuto non è disponibile nella lingua selezionata.
Chapter 11. Migrating authentication from nslcd to SSSD
11.1. Migrating a RHEL client from nslcd to SSSD Copia collegamentoCollegamento copiato negli appunti!
As the nss-pam-ldapd package has been removed from RHEL, Red Hat recommends migrating to SSSD and its ldap provider, which replaces the functionality of the nslcd service. The following procedure describes how to configure SSSD to authenticate LDAP users on a client that was previously configured to use an nss-pam-ldap authentication configuration.
Prerequisites
- Your RHEL client is on RHEL 8 or RHEL 9.
-
You have previously configured the RHEL client to authenticate to an LDAP directory server with the
nslcdservice. - The LDAP directory service uses a schema defined in RFC-2307.
Procedure
Back up the current authentication configuration:
authselect apply-changes -b --backup=ldap-configuration-backup
# authselect apply-changes -b --backup=ldap-configuration-backupCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install
SSSDpackages:yum install sssd-ldap sssd-ad sssd-client \ sssd-common sssd-common-pac \ sssd-krb5 sssd-krb5-common
# yum install sssd-ldap sssd-ad sssd-client \ sssd-common sssd-common-pac \ sssd-krb5 sssd-krb5-commonCopy to Clipboard Copied! Toggle word wrap Toggle overflow Stop and disable the
nslcdandnscdservices:systemctl stop nslcd nscd systemctl disable nslcd nscd
# systemctl stop nslcd nscd # systemctl disable nslcd nscdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure authentication with
SSSD:authselect select sssd with-mkhomedir --force
# authselect select sssd with-mkhomedir --forceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set the necessary ownership and permissions for the
SSSDconfiguration file:chown root:root /etc/sssd/sssd.conf chmod 600 /etc/sssd/sssd.conf
# chown root:root /etc/sssd/sssd.conf # chmod 600 /etc/sssd/sssd.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Open the
/etc/sssd/sssd.conffile for editing. Enter the following configuration, replacing values such as
example.comanddc=example,dc=comwith values that are appropriate for your environment:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou might need to specify the LDAP schema in your
SSSDconfiguration:If you are using the RFC-2307bis schema in your directory server, add the following line to the
[domain/EXAMPLE.COM]section:ldap_schema = rfc2307bis
ldap_schema = rfc2307bisCopy to Clipboard Copied! Toggle word wrap Toggle overflow If you are using a Microsoft Active Directory server, add the following line to the
[domain/EXAMPLE.COM]section to enable LDAP-based authentication:ldap_schema = ad
ldap_schema = adCopy to Clipboard Copied! Toggle word wrap Toggle overflow If you need Kerberos authentication, Red Hat recommends joining the RHEL client to your AD domain with the
realmcommand, which automatically configures theSSSDservice.Enable and start the
SSSDservice:systemctl enable sssd systemctl start sssd
# systemctl enable sssd # systemctl start sssdCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Ensure you can retrieve information about your LDAP users:
id ldapuser getent passwd ldapuser
# id ldapuser uid=100424(ldapuser) gid=100424(ldapuser) groups=100424(ldapuser) # getent passwd ldapuser ldapuser:*: 100424: 100424:User, LDAP:/home/ldapuser:/bin/bashCopy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure you can log in as an LDAP user:
ssh -l ldapuser localhost
# ssh -l ldapuser localhost ldapuser@localhost's password: Last login: Tue Dec 07 19:34:35 2021 from localhost -sh-4.2$Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If you need to restore your original LDAP configuration with nslcd and nscd, use the following commands:
authselect backup-restore=ldap-configuration-backup systemctl stop sssd && systemctl disable sssd systemctl start nslcd nscd systemctl enable nslcd nscd
# authselect backup-restore=ldap-configuration-backup
# systemctl stop sssd && systemctl disable sssd
# systemctl start nslcd nscd
# systemctl enable nslcd nscd
11.2. sssd.conf option equivalents of nslcd.conf options Copia collegamentoCollegamento copiato negli appunti!
To help with migrating from nslcd to SSSD, the following table shows common options from the nslcd.conf configuration file and their equivalent options in the sssd.conf configuration file.
nslcd.conf option | sssd.conf option | Description |
|---|---|---|
|
| No equivalent |
The user id with which the daemon should be run. By default, SSSD runs as the |
|
| No equivalent |
The group id with which the daemon should be run. By default, SSSD runs as the |
|
|
|
The URI of the LDAP server in the following format: |
|
|
| The distinguished name of the search base. |
|
|
| The default bind DN to use for performing LDAP operations |
|
|
| The authentication token of the default bind DN. Only clear text passwords are currently supported. |
|
|
| The authentication token of the default bind DN. Only clear text passwords are currently supported. |
|
|
| Specifies what checks to perform on a server-supplied certificate. |
|
|
| The file that contains certificates for all of the Certificate Authorities |
|
|
| The path of a directory that contains Certificate Authority certificates in separate individual files. |
|
|
| An optional base DN, search scope and LDAP filter to restrict LDAP searches for users. |
|
|
| An optional base DN, search scope and LDAP filter to restrict LDAP searches for groups. |