- Technology stack
- Architecture of the Solution
- Installing and Configuring MULTIDIRECTORY
- Configuring Kerberos in the MULTIDIRECTORY Web Interface
- Configuring DNS in the MULTIDIRECTORY Web Interface
- DHCP Configuration
- Domain Trust Configuration
- Group Policy
- Connecting MULTIFACTOR Self-Service Portal to MULTIDIRECTORY
- User, Group, and Resource Management
- Connecting to MULTIFACTOR
- Access Policies
- LDAP Schema
- LDAP Logging Configuration
- Password Policies
- Role and Permission Configuration
- LDAP Authentication in Ansible AWX
- LDAP Authentication in ArgoCD
- LDAP Authentication in GitLab
- LDAP Authentication in GitFlic
- LDAP Authentication in Jenkins
- LDAP Authentication in Harbor
- LDAP Authentication in Nexus
- LDAP Authentication in PostgreSQL
- LDAP Authentication in Rancher
- LDAP Authentication in Proxmox VE
- LDAP Authentication in SpaceVM
- LDAP Authentication in Tantor
- LDAP Authentication in Shturval
- LDAP Authentication in zVirt
- LDAP Authentication in GLPI
Instructions for configuring LDAP authentication on an SSH client
Prerequisites
The article describes how to configure LDAP authentication on an SSH client where MULTIDIRECTORY is the account provider.
Preparation Steps
- Create a service account in MULTIDIRECTORY with read-only access to the directory.
- Create SSH access groups in MULTIDIRECTORY to control which users can authenticate via SSH.
Integration with the MULTIFACTOR two-factor authentication system
Connect and configure MULTIDIRECTORY-2FA access.
Installing packages and configuring libnss-ldapd
To configure LDAP authentication on the SSH client, install the following packages:
apt -y install libnss-ldapd libpam-ldapd ldap-utils
After successfully installing the packages, the libnss-ldapd configuration window will appear:
Below is an example of how to fill it out
Specify the LDAP server URI: ldap://your_domain.ru

Specify the LDAP server search base: dc=your_domain,dc=ru

Select names for customizable services:
- passwd.
- group.
- shadow.

Configuring automatic creation of a home directory for a new user
Go to the common-session file to configure automatic creation of home directories for users.
sudo nano /etc/pam.d/common-session
Add the following field as the last line:
session optional pam_mkhomedir.so skel=/etc/skel umask=077
After adding, the file should look like this:
# # /etc/pam.d/common-session - session-related modules common to all services # # This file is included from other service-specific PAM config files, # and should contain a list of modules that define tasks to be performed # at the start and end of interactive sessions. # # As of pam 1.0.1-6, this file is managed by pam-auth-update by default. # To take advantage of this, it is recommended that you configure any # local modules either before or after the default block, and use # pam-auth-update to manage selection of other modules. See # pam-auth-update(8) for details. # here are the per-package modules (the "Primary" block) session [default=1] pam_permit.so # here's the fallback if no module succeeds session requisite pam_deny.so # prime the stack with a positive return value if there isn't one already; # this avoids us returning an error just because nothing sets a success code # since the modules above will each just jump around session required pam_permit.so # and here are more per-package modules (the "Additional" block) session required pam_unix.so session optional pam_systemd.so # end of pam-auth-update config session optional pam_mkhomedir.so skel=/etc/skel umask=077
Configuring nslcd
Go to the nslcd.conf file, uncomment the binddn and bindpw fields, and enter the account details that will be used to read the directory.
note!
This account must have read permissions for the entire directory service.
In the bindpw field, you will need to specify the password for the account entered in binddn.
The binddn field also accepts data in UPN format (example: administrator@your_domain.ru).
# /etc/nslcd.conf # nslcd configuration file. See nslcd.conf(5) # for details. # The user and group nslcd should run as. uid nslcd gid nslcd # The location at which the LDAP server(s) should be reachable. uri ldap://your_domain.ru # The search base that will be used for all queries. base dc=your_domain,dc=ru # The LDAP protocol version to use. #ldap_version 3 # The DN to bind with for normal lookups. binddn cn=administrator,cn=users,dc=your_domain,dc=ru bindpw password # The DN used for password modifications by root. #rootpwmoddn cn=admin,dc=example,dc=com # SSL options #ssl off #tls_reqcert never tls_cacertfile /etc/ssl/certs/ca-certificates.crt # The search scope. #scope sub
You need to change the access rights to the nslcd.conf file, as it stores authentication information:
chmod 600 /etc/nslcd.conf chown nslcd:nslcd /etc/nslcd.conf
Launch
After configuring the settings, start the component:
sudo systemctl start nslcd nscd
You can check the status with the command:
sudo systemctl status nslcd sudo systemctl status nscd
Subsequent changes to the service configuration file will require restarting the services subsystem and the service:
sudo systemctl daemon-reload sudo systemctl restart nslcd nscd
Installing and configuring packages
To configure LDAP authentication on the SSH client, install the following packages:
sudo apt install -y sssd libpam-sss libnss-sss sssd-tools krb5-user
Configuring SSSD
The configuration is located at /etc/sssd/sssd.conf
Configuration example:
[sssd] domains = domain.ru # Specify the MULTIDIRECTORY domain services = nss, pam, ssh config_file_version = 2 [domain/domain.ru] id_provider = ldap auth_provider = krb5 ldap_uri = ldap://domain.ru # Selecting the ldap/s 389/636 port protocol ldap_search_base = dc=domain,dc=ru # Searching the LDAP database ldap_user_search_base = cn=users,dc=domain,dc=ru # Search in the ldap_user database ldap_group_search_base = cn=groups,dc=domain,dc=ru # Searching the ldap_group database ldap_default_bind_dn = cn=admin,cn=users,dc=domain,dc=ru # Service account with catalog read permissions ldap_default_authtok = PASSWORD # Service account password krb5_server = domain.ru krb5_realm = DOMAIN.RU # Kerberos realm must be in uppercase letters krb5_kpasswd = domain.ru enumerate = true cache_credentials = true dyndns_update = false fallback_homedir = /home/%u
For correct operation, change the permissions on the sssd.conf configuration file:
sudo chmod 600 /etc/sssd/sssd.conf
Kerberos configuration
The configuration is located at /etc/krb5.conf.
Example krb5.conf configuration:
[libdefaults]
default_realm = DOMAIN.RU # Kerberos-realm must be in uppercase letters.
dns_lookup_realm = false
dns_lookup_kdc = false
[realms]
DOMAIN.RU = {
kdc = domain.ru # The host address where MULTIDIRECTORY is located
admin_server = domain.ru # The host address where MULTIDIRECTORY is located
}
[domain_realm]
.domain.ru = DOMAIN.RU
domain.ru = DOMAIN.RU
Configuring automatic creation of a home directory for a new user
To enable automatic creation of user directories, modify the /etc/pam.d/common-session file.
Add the following line to the end of the file:
session optional pam_mkhomedir.so skel=/etc/skel umask=077
Launch and verification
To start, execute the commands
systemctl enable sssd systemctl restart sssd
To verify, log in via SSH to localhost with the domain user:
ssh <ldap_user>@localhost