• Contact Us
  • Home
  • Installation
  • Configuration

Configure SSSD with LDAP on Ubuntu Client

Discover how to set up and configure SSSD with LDAP on your client machine for seamless integration and authentication with a central user directory.

Written by Seaghan McNelis

Updated at March 21st, 2025

  • Quick Start
  • Installation
    Best Practices Configuration Troubleshooting Design Performance Platform
  • Maintenance
    Releases Upgrade
  • Reference
+ More

Replace ‘certfile.crt’ with your own .crt file.

Before proceeding make sure you have a CA certificate created, learn how to by clicking here.

1. Place the CA certificate in the necessary directory:

/opt/symas/ssl/ca/certfile.crt

2. If /opt/symas/ssl/ca/ does not exist, create the directory: 

mkdir -p /opt/symas/ssl/ca/

3. Install SSSD client on the Ubuntu client: 

apt install sssd libpam-sss libnss-sss sssd-tools oddjob-mkhomedir

4. Configure nsswitch.conf:

vi /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd: 	sss files systemd
group: 		sss files systemd
shadow: 	files sss
gshadow: 	files

hosts: 		files dns
networks: 	files
protocols: 	db files
services: 	db files sss
ethers: 	db files
rpc: 		db files
netgroup: 	nis sss
automount: 	sss

5. Create and Configure SSSD configuration:   

vi /etc/sssd/sssd.conf
[sssd]
services = nss, pam
config_file_version = 2
domains = example

[nss]

[pam]
offline_credentials_expiration = 60

[domain/example]
ldap_id_use_start_tls = True
cache_credentials = True
ldap_search_base = ou=people,dc=example,dc=com
ldap_group_search_base = ou=groups,dc=example,dc=com?subtree?
(objectclass=posixGroup)
ldap_netgroup_search_base = ou=netgroups,dc=example,dc=com?subtree?
(objectclass=nisNetGroup)
id_provider = ldap
auth_provider = ldap
chpass_provider = ldap
access_provider = ldap
ldap_uri = ldap://example.com
ldap_default_bind_dn = cn=admin,dc=example,dc=com
ldap_default_authtok = secret
ldap_tls_reqcert = demand
ldap_tls_cacert = /opt/symas/ssl/ca/certfile.crt
ldap_tls_cacertdir = /opt/symas/ssl/ca
ldap_search_timeout = 50
ldap_network_timeout = 60
ldap_access_order = filter
ldap_access_filter = (objectClass=posixAccount)
enumerate = True

6. Configure auto-home directory creation: 

vi /etc/pam.d/common-session
#
# /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
# The pam_umask module will set the umask according to the system default in
# /etc/login.defs and user settings, solving the problem of different
# umask settings with different shells, display managers, remote sessions etc.
# See "man pam_umask".
session optional 						pam_umask.so
# and here are more per-package modules (the "Additional" block)
session required 		pam_unix.so
session optional 						pam_sss.so
session optional 						pam_ldap.so
session optional 		pam_systemd.so
session required 			pam_mkhomedir.so skel=/etc/skel/ umask=0022
# end of pam-auth-update config

7. Use authconfig to recalibrate login process for pam: 

authconfig --enablesssdauth --enablesssd --enablemkhomedir --updateall

If you receive the error ‘authconfig: command not found’, use the following command to install the utility: 

apt install ldap-auth-config

8. Check sssd.conf for errors: 

sssctl config-check

9. To clear SSSD cache, if needed:

service sssd stop
sss_cache -E
rm -f /var/lib/sss/db/*
service sssd start

 

Copyright © 2020-2024 Symas Corporation. All rights reserved.
ldap integration sssd setup

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Configuring iptables (Opening LDAP Ports)
  • Logging Configuration for RHEL / Centos
  • Configure SSSD with LDAP on CentOS/RHEL6 Client
  • Configure SSSD with LDAP on CentOS/RHEL7 Client
  • Symas Blog RSS Feed
  • Symas on Facebook
  • Symas on Twitter
  • Symas Blog
  • Symas on LinkedIn
  • Symas YouTube Channel

Copyright © 2023, Symas Corporation. All rights reserved. Privacy Statement (updated July 31, 2023)

Phone:

Main Office: +1.650.963.7601
Fax: +1.650.390.6284

Email:

Sales: sales@symas.com
Support: support@symas.com

Office Hours:

8:00 AM - 5:00 PM ET

Office Location:

Symas Corporation
PO Box 391
Grand Junction, CO 81507 USA

Expand