Setting Up LDAP-based Authentication in RHEL 8

To configure LDAP-based authentication in RHEL 8, install required packages, adjust configuration files, and configure LDAP server details in sssd.conf. To apply the modifications, restart the sssd service after that. Finally, login using an LDAP user account to check the LDAP authentication. User authentication across several systems is made simpler with LDAP-based authentication, which offers a centralised user management solution.

What is LDAP?

LDAP, or the Lightweight Directory Access Protocol, is the protocol that RHEL 8 Linux uses to configure LDAP-based authentication. It is a defined method for managing directory data, including user accounts and related properties, on a network. User management across several systems is made easier by the common store for user credentials provided by LDAP. In RHEL 8, LDAP can be used as an authentication source, enabling users to leverage LDAP servers for authentication rather than only local system accounts. This method offers a user authentication mechanism in Linux systems that is more effective and scalable.

Methods Used

  • Command Line Interface

  • Graphical User Interface

Command Line Interface

LDAP-based authentication configuration in RHEL 8 is made possible through the Command-Line Interface (CLI), which offers a text-based interface for system activities and configurations. Sssd and openldap-clients, two crucial LDAP packages, can be installed by administrators via the CLI. They can set LDAP as the authentication source and enter server information by altering configuration files like /etc/nsswitch.conf and /etc/sssd/sssd.conf. LDAP users can be authenticated by administrators by logging in via the CLI and restarting the sssd service to guarantee proper configuration. In order to give administrators a simple and effective method for configuring LDAP-based authentication and managing user authentication across many systems, RHEL 8 makes use of the CLI's efficiency and simplicity.


  • Install LDAP packages

    Install the necessary LDAP packages, such as openldap-clients and sssd, using the CLI.

sudo yum install openldap-clients sssd
  • Set up an LDAP client 

    Furthermore, through CLI make changes in the text editor by following the command mentioned below.

sudo nano /etc/nsswitch.conf
  • Indicate "ldap" in the "passwd," "shadow," and "group" lines as the authentication source.

passwd:     files ldap
shadow:     files ldap
group:      files ldap
  • Setup the sssd.conf file 

    Furthermore, use the following command to change the CLI

sudo nano /etc/sssd/sssd.conf
  • Give the IP address, port number, and bind credentials for the LDAP server.

id_provider = ldap
auth_provider = ldap
ldap_uri = ldap://ldap-server-address:389
ldap_search_base = dc=example,dc=com
ldap_tls_reqcert = never
ldap_tls_cacert = /path/to/cacert.pem
ldap_default_bind_dn = cn=admin,dc=example,dc=com
ldap_default_authtok = admin_password
  • Restart the sssd service to apply the configuration changes made in the previous stages.

    Restart the sssd service using the CLI.

sudo systemctl restart sssd
  • Test LDAP authentication: To test the LDAP-based authentication configuration, try logging in using LDAP user accounts.

    Use the CLI to check whether authentication and system access were successful.

Graphical User Interface

LDAP-based authentication can be implemented more easily with the help of RHEL 8's Graphical User Interface (GUI), which offers a visual user interface. Users may easily access system settings, browse menus, and enter setup data using a mouse and keyboard. Users can choose LDAP as the authentication source, enter LDAP server information, and modify user authentication settings with GUI tools like "authconfig" and "system-config-authentication." By doing away with the need for manual configuration file updates, this logical and user-friendly method makes it simpler for administrators to set up LDAP-based authentication. The LDAP configuration procedure is streamlined in RHEL 8's GUI, making it easier for administrators to utilize.


  • Start the RHEL eight machine's Graphical User Interface (GUI) by logging in and getting access to the computing device environment.

  • Open the machine settings menu or locate authentication-associated gear in the GUI interface to continue with the setup.

  • Launch the LDAP authentication setup device, along with "authconfig" or "machine-config-authentication," from the to-be-had alternatives within the machine settings.

  • Within the LDAP authentication device, discover and choose the right segment devoted to LDAP configuration for similar customization.

  • Choose LDAP because it is the authentication source to set up LDAP-primarily-based total authentication for the machine.

  • Provide the LDAP server with a wide variety within the respective fields to ensure the right verbal exchange with the LDAP server.

  • Enter the desired login credentials, along with a username and password, to authenticate with the LDAP server.

  • Adjust extra settings as necessary, along with specifying the LDAP seek base or allowing SSL or TLS encryption for steady verbal exchange.

  • Save the configuration modifications made at some point in the setup system to use the LDAP authentication settings.

  • Exit the LDAP authentication configuration device to finalise the setup and complete the LDAP authentication integration into the RHEL eight machine's GUI.


Last but not least, configuring LDAP-based authentication in RHEL 8 offers a centralized and effective solution for user administration across several systems. Administrators can configure LDAP as the authentication source by utilizing the LDAP protocol, streamlining user authentication procedures. Using the GUI or the Command-Line Interface (CLI), administrators can configure the required packages, specify LDAP server details, modify LDAP client settings, and check LDAP authentication. This approach offers scalability, flexibility, and better security by depending on LDAP servers for user authentication. LDAP-based authentication makes user management simpler in RHEL 8, making it easier to track down and manage access to systems inside a network context.

Updated on: 03-Aug-2023

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started