7.5. Configuring System Services for SSSD
			SSSD provides interfaces towards several system services. Most notably:
		
- Name Service Switch (NSS)
- Pluggable Authentication Modules (PAM)
- OpenSSH
- See Configuring SSSD to Provide a Cache for the OpenSSH Services in the Linux Domain Identity, Authentication, and Policy Guide.
- autofs
- sudo
7.5.1. Configuring Services: NSS
Copy linkLink copied to clipboard!
How SSSD Works with NSS
				The Name Service Switch (NSS) service maps system identities and services with configuration sources: it provides a central configuration store where services can look up sources for various configuration and name resolution mechanisms.
			
				SSSD can use NSS as a provider for several types of NSS maps. Most notably:
			
- User information (thepasswdmap)
- Groups (thegroupsmap)
- Netgroups (thenetgroupsmap)
- Services (theservicesmap)
Prerequisites
- Install SSSD.yum install sssd # yum install sssdCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
Configure NSS Services to Use SSSD
- Use theauthconfigutility to enable SSSD:authconfig --enablesssd --update [root@server ~]# authconfig --enablesssd --updateCopy to Clipboard Copied! Toggle word wrap Toggle overflow This updates the/etc/nsswitch.conffile to enable the following NSS maps to use SSSD:passwd: files sss shadow: files sss group: files sss netgroup: files sss passwd: files sss shadow: files sss group: files sss netgroup: files sssCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- Open/etc/nsswitch.confand addsssto theservicesmap line:services: files sss services: files sssCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
Configure SSSD to work with NSS
- Open the/etc/sssd/sssd.conffile.
- In the[sssd]section, make sure that NSS is listed as one of the services that works with SSSD.[sssd] [... file truncated ...] services = nss, pam [sssd] [... file truncated ...] services = nss, pamCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- In the[nss]section, configure how SSSD interacts with NSS. For example:[nss] filter_groups = root filter_users = root entry_cache_timeout = 300 entry_cache_nowait_percentage = 75 [nss] filter_groups = root filter_users = root entry_cache_timeout = 300 entry_cache_nowait_percentage = 75Copy to Clipboard Copied! Toggle word wrap Toggle overflow For a complete list of available options, seeNSS configuration optionsin the sssd.conf(5) man page.
- Restart SSSD.systemctl restart sssd.service # systemctl restart sssd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
Test That the Integration Works Correctly
				Display information about a user with these commands:
			
- id user
- getent passwd user
7.5.2. Configuring Services: PAM
Copy linkLink copied to clipboard!
Warning
					A mistake in the PAM configuration file can lock users out of the system completely. Always back up the configuration files before performing any changes, and keep a session open so that you can revert any changes.
				
Configure PAM to Use SSSD
- Use theauthconfigutility to enable SSSD:authconfig --enablesssdauth --update # authconfig --enablesssdauth --updateCopy to Clipboard Copied! Toggle word wrap Toggle overflow This updates the PAM configuration to reference the SSSD modules, usually in the/etc/pam.d/system-authand/etc/pam.d/password-authfiles. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 
				For details, see the pam.conf(5) or pam(8) man pages.
			
Configure SSSD to work with PAM
- Open the/etc/sssd/sssd.conffile.
- In the[sssd]section, make sure that PAM is listed as one of the services that works with SSSD.[sssd] [... file truncated ...] services = nss, pam [sssd] [... file truncated ...] services = nss, pamCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- In the[pam]section, configure how SSSD interacts with PAM. For example:[pam] offline_credentials_expiration = 2 offline_failed_login_attempts = 3 offline_failed_login_delay = 5 [pam] offline_credentials_expiration = 2 offline_failed_login_attempts = 3 offline_failed_login_delay = 5Copy to Clipboard Copied! Toggle word wrap Toggle overflow For a complete list of available options, seePAM configuration optionsin the sssd.conf(5) man page.
- Restart SSSD.systemctl restart sssd.service # systemctl restart sssd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
Test That the Integration Works Correctly
- Try logging in as a user.
- Use thesssctl user-checks user_name authcommand to check your SSSD configuration. For details, use thesssctl user-checks --helpcommand.
7.5.3. Configuring Services: autofs
Copy linkLink copied to clipboard!
How SSSD Works with automount
				The 
automount utility can mount and unmount NFS file systems automatically (on-demand mounting), which saves system resources. For details on automount, see autofs in the Storage Administration Guide.
			
				You can configure 
automount to point to SSSD. In this setup:
			- When a user attempts to mount a directory, SSSD contacts LDAP to obtain the required information about the currentautomountconfiguration.
- SSSD stores the information required byautomountin a cache, so that users can mount directories even when the LDAP server is offline.
Configure autofs to Use SSSD
- Install the autofs package.yum install autofs # yum install autofsCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- Open the/etc/nsswitch.conffile.
- On theautomountline, change the location where to look for theautomountmap information fromldaptosss:automount: files sss automount: files sssCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
Configure SSSD to work with autofs
- Open the/etc/sssd/sssd.conffile.
- In the[sssd]section, addautofsto the list of services that SSSD manages.[sssd] services = nss,pam,autofs [sssd] services = nss,pam,autofsCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- Create a new[autofs]section. You can leave it empty.[autofs] [autofs]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For a list of available options, seeAUTOFS configuration optionsin the sssd.conf(5) man page.
- Make sure an LDAP domain is available insssd.conf, so that SSSD can read theautomountinformation from LDAP. See Section 7.3.2, “Configuring an LDAP Domain for SSSD”.The[domain]section ofsssd.confaccepts severalautofs-related options. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow For a complete list of available options, seeDOMAIN SECTIONSin the sssd.conf(5) man page.If you do not provide additionalautofsoptions, the configuration depends on the identity provider settings.
- Restart SSSD.systemctl restart sssd.service # systemctl restart sssd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
Test the Configuration
- Use theautomount -mcommand to print the maps from SSSD.
7.5.4. Configuring Services: sudo
Copy linkLink copied to clipboard!
How SSSD Works with sudo
				The 
sudo utility gives administrative access to specified users. For more information about sudo, see The sudo utility documentation in the System Administrator's Guide.
			
				You can configure 
sudo to point to SSSD. In this setup:
			- When a user attempts asudooperation, SSSD contacts LDAP or AD to obtain the required information about the currentsudoconfiguration.
- SSSD stores thesudoinformation in a cache, so that users can performsudooperations even when the LDAP or AD server is offline.
				SSSD only caches 
sudo rules which apply to the local system, depending on the value of the sudoHost attribute. See the sssd-sudo(5) man page for details.
			Configure sudo to Use SSSD
- Open the/etc/nsswitch.conffile.
- Add SSSD to the list on thesudoersline.sudoers: files sss sudoers: files sssCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
Configure SSSD to work with sudo
- Open the/etc/sssd/sssd.conffile.
- In the[sssd]section, addsudoto the list of services that SSSD manages.[sssd] services = nss,pam,sudo [sssd] services = nss,pam,sudoCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- Create a new[sudo]section. You can leave it empty.[sudo] [sudo]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For a list of available options, seeSUDO configuration optionsin the sssd.conf(5) man page.
- Make sure an LDAP or AD domain is available insssd.conf, so that SSSD can read thesudoinformation from the directory. For details, see:- the Using Active Directory as an Identity Provider for SSSD section in the Windows Integration Guide.
 The[domain]section for the LDAP or AD domain must include thesesudo-related parameters:[domain/LDAP_or_AD_domain] ... sudo_provider = ldap ldap_sudo_search_base = ou=sudoers,dc=example,dc=com [domain/LDAP_or_AD_domain] ... sudo_provider = ldap ldap_sudo_search_base = ou=sudoers,dc=example,dc=comCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note Setting Identity Management or AD as the ID provider automatically enables thesudoprovider. In this situation, it is not necessary to specify thesudo_providerparameter.For a complete list of available options, seeDOMAIN SECTIONSin the sssd.conf(5) man page.For options available for asudoprovider, see the sssd-ldap(5) man page.
- Restart SSSD.systemctl restart sssd.service # systemctl restart sssd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
				If you use AD as the provider, you must extend the AD schema to support 
sudo rules. For details, see the sudo documentation.
			
				For details about providing 
sudo rules in LDAP or AD, see the sudoers.ldap(5) man page.