| |

LFCE 157 ๐Ÿง LFCE Exam Objectives Review โ€” Domain 3

โฑ๏ธ Estimated read: 10 min | |

Domain 3 of the LFCE exam is User and Group Management, and it carries a weight of 10% . The official competencies, updated in June 2018, list only two items: connect to an external authentication source, and configure advanced PAM . The small number of competencies is deceptive. The domain tests the infrastructure that every other domain depends on: the identity system that decides who can log in, what they can access, and how their credentials are verified across a fleet of machines.

This chapter reviews the two competencies, the tools that implement them, and the connection to the Service Configuration domain, where the centralized authentication server is configured. It is a review, not a tutorial: the goal is to confirm that the candidate can perform each task from the command line.

Key point: The domain is not about useradd and groupadd. Those are LFCS-level skills. The LFCE-level skills are the external authentication source (LDAP or Kerberos) and the PAM stack that integrates the source with the local system. The candidate must understand how a login request flows from the application through PAM to the authentication backend.


Why the domain is small but critical

The identity problem. A fleet of servers with local /etc/passwd files is a fleet where every user account must be created on every machine. When an employee leaves, the account must be removed from every machine. The external authentication source solves this by centralizing the identity data. The LFCE tests the client side: how a Linux system connects to an LDAP directory or a Kerberos realm and uses it for login .

The PAM problem. PAM (Pluggable Authentication Modules) is the layer between the application and the authentication mechanism. When sshd receives a login request, it calls PAM, and PAM calls the configured modules. The pam_unix module checks the local /etc/shadow. The pam_ldap or pam_sss module checks the directory. The pam_mfa module checks a second factor. The candidate must be able to read a PAM configuration file and explain which modules run in which order .

The integration problem. The external source and PAM are not separate topics. The source is the data store; PAM is the mechanism that queries it. The nsswitch.conf file determines which source the system uses for user and group lookups. The sssd daemon caches the directory data and provides the PAM integration. The candidate must be able to configure both.


a. Connect to an external authentication source

The external source is a directory service: LDAP, Active Directory, or Kerberos. The client configuration depends on the distribution. On RHEL-family systems, the tool is authselect (or authconfig on older versions). On Debian-family systems, the tool is pam-auth-update and the manual configuration of nsswitch.conf and /etc/sssd/sssd.conf.

The sssd (System Security Services Daemon) is the modern client. It provides the NSS and PAM integration, caches the directory data for offline login, and supports multiple backends. The configuration file is /etc/sssd/sssd.conf, and it defines the domain, the provider (LDAP or AD), the server URI, and the search base.

[sssd]
domains = example.com
services = nss, pam

[domain/example.com]
id_provider = ldap
auth_provider = ldap
ldap_uri = ldap://ldap.example.com
ldap_search_base = dc=example,dc=com
ldap_default_bind_dn = cn=admin,dc=example,dc=com
ldap_default_authtok = password

The nsswitch.conf file must route the passwd, group, and shadow lookups to sss. The pam service must include the pam_sss.so module. The authselect tool configures both in one step on RHEL-family systems.

The candidate should be able to verify the connection with getent passwd <user>, which queries the NSS layer and returns the user from the directory. The id <user> command shows the UID, GID, and groups. The sssctl user-checks <user> command (on systems with SSSD) shows the authentication and authorization status.


b. Configure advanced PAM

PAM configuration lives in /etc/pam.d/. Each service has its own file: sshd, login, su, sudo, system-auth (or common-auth on Debian). The file contains a stack of modules, each with a type, a control flag, and a module path.

The four module types are auth (verify identity), account (check if the account is valid), password (change the password), and session (set up and tear down the session). The control flags are required, requisite, sufficient, and optional. The required module must succeed, but the failure is not reported until all modules have run. The requisite module must succeed, and the failure is reported immediately. The sufficient module, if it succeeds, skips the rest of the stack .

# /etc/pam.d/sshd (simplified)
auth       required     pam_env.so
auth       sufficient   pam_unix.so nullok try_first_pass
auth       required     pam_deny.so
account    required     pam_unix.so
session    required     pam_limits.so

The candidate should be able to add a module to a stack, change a control flag, and explain the effect. The pam_tally2 or pam_faillock module locks an account after a number of failed attempts. The pam_mkhomedir module creates the home directory on first login. The pam_access module restricts access by host or user. These are the “advanced” PAM configurations that the competency refers to.

The pam.d files are critical. A syntax error or a misordered module can lock every user out of the system, including root. The candidate should test the configuration in a separate terminal before closing the current session.


Complete Example Session

# ============================================
# PART 1: THE SSSD CONFIGURATION
# ============================================
# /etc/sssd/sssd.conf
[sssd]
domains = example.com
services = nss, pam

[domain/example.com]
id_provider = ldap
auth_provider = ldap
ldap_uri = ldap://ldap.example.com
ldap_search_base = dc=example,dc=com
# ============================================
# PART 2: THE NSSWITCH CONFIGURATION
# ============================================
# /etc/nsswitch.conf
passwd:     files sss
group:      files sss
shadow:     files sss
# ============================================
# PART 3: THE AUTHSELECT (RHEL)
# ============================================
authselect select sssd with-mkhomedir --force
# ============================================
# PART 4: THE VERIFICATION
# ============================================
getent passwd alice
id alice
sssctl user-checks alice
# ============================================
# PART 5: THE PAM STACK
# ============================================
# /etc/pam.d/sshd
auth       required     pam_env.so
auth       sufficient   pam_unix.so nullok try_first_pass
auth       required     pam_deny.so
# ============================================
# PART 6: THE FAILED ATTEMPT LOCKOUT
# ============================================
# /etc/pam.d/system-auth
auth       required     pam_faillock.so preauth silent audit deny=3 unlock_time=600
auth       sufficient   pam_unix.so
auth       required     pam_faillock.so authfail audit deny=3 unlock_time=600
# ============================================
# PART 7: THE HOME DIRECTORY CREATION
# ============================================
# /etc/pam.d/system-auth
session    required     pam_mkhomedir.so skel=/etc/skel umask=0022
# ============================================
# PART 8: THE ACCESS RESTRICTION
# ============================================
# /etc/pam.d/sshd
account    required     pam_access.so
# /etc/security/access.conf
- : ALL : ALL EXCEPT LOCAL
# ============================================
# PART 9: THE PAM TEST
# ============================================
# In a separate terminal:
su - alice
# If the login fails, the current session is still open.
# ============================================
# PART 10: THE TROUBLESHOOTING
# ============================================
journalctl -u sssd -f
tail -f /var/log/secure

The ten parts covered the SSSD configuration, nsswitch.conf, authselect, verification, the PAM stack, the failed-attempt lockout, the home directory creation, the access restriction, the PAM test, and the troubleshooting.


Quick Reference

Domain 3 competencies

CompetencyTools
External authentication sourcesssd, authselect, nsswitch.conf
Advanced PAM/etc/pam.d/, pam_faillock, pam_mkhomedir, pam_access

SSSD configuration

SectionPurpose
[sssd]Domains and services
[domain/<name>]Provider, URI, search base
id_providerIdentity lookup backend
auth_providerAuthentication backend

NSS configuration

DatabaseService
passwdfiles sss
groupfiles sss
shadowfiles sss

PAM module types

TypePurpose
authVerify identity
accountCheck account validity
passwordChange password
sessionSet up/tear down session

PAM control flags

FlagBehavior
requiredMust succeed; failure deferred
requisiteMust succeed; failure immediate
sufficientSuccess skips rest
optionalSuccess or failure does not affect outcome

Best Practices

โœ… Do This:

# Verify the external source before configuring PAM
getent passwd alice                                         # โœ…
# Test PAM changes in a separate terminal
su - alice  # in a new terminal                              # โœ…
# Use sssd for the directory integration
id_provider = ldap                                          # โœ…
# Add pam_mkhomedir for directory users
session required pam_mkhomedir.so skel=/etc/skel            # โœ…

โŒ Don’t Do This:

# Edit /etc/pam.d/ without a backup
vim /etc/pam.d/sshd                                         # โŒ
# Close the current session after editing PAM
exit                                                        # โŒ (may lock out)
# Use pam_unix for a directory user without SSSD
auth sufficient pam_unix.so                                 # โŒ (user not in /etc/passwd)

Common Pitfalls

PitfallWhy It HappensFix
Directory user cannot log innsswitch.conf not updatedAdd sss to passwd, group, shadow
SSSD does not startWrong permissions on sssd.confchmod 600 /etc/sssd/sssd.conf
PAM change locks out rootMisordered stackBoot rescue, revert the change
Home directory not createdpam_mkhomedir missingAdd the session module
Failed attempts not lockedpam_faillock missingAdd the auth module

Real-World Examples

1. SSSD configuration

[domain/example.com]
id_provider = ldap
ldap_uri = ldap://ldap.example.com

2. NSS routing

passwd: files sss

3. Authselect

authselect select sssd with-mkhomedir

4. Getent verification

getent passwd alice

5. PAM stack

auth sufficient pam_unix.so

6. Failed-attempt lockout

auth required pam_faillock.so preauth silent audit deny=3

7. Home directory creation

session required pam_mkhomedir.so

8. Access restriction

account required pam_access.so

9. SSSD logs

journalctl -u sssd -f

10. The test

su - alice

Visual

The authentication flow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  sshd                                                        โ”‚
โ”‚    โ””โ”€โ”€ PAM stack                                            โ”‚
โ”‚          โ”œโ”€โ”€ pam_env.so                                      โ”‚
โ”‚          โ”œโ”€โ”€ pam_sss.so โ”€โ”€โ–บ SSSD โ”€โ”€โ–บ LDAP directory         โ”‚
โ”‚          โ””โ”€โ”€ pam_deny.so                                     โ”‚
โ”‚                                                              โ”‚
โ”‚  If pam_sss succeeds, the login proceeds.                    โ”‚
โ”‚  If it fails, pam_deny rejects.                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The NSS routing

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  getent passwd alice                                         โ”‚
โ”‚       โ”‚                                                      โ”‚
โ”‚       โ–ผ                                                      โ”‚
โ”‚  nsswitch.conf: passwd: files sss                           โ”‚
โ”‚       โ”‚                                                      โ”‚
โ”‚       โ”œโ”€โ”€ files: /etc/passwd (not found)                    โ”‚
โ”‚       โ”‚                                                      โ”‚
โ”‚       โ””โ”€โ”€ sss: SSSD โ”€โ”€โ–บ LDAP (found)                        โ”‚
โ”‚                                                              โ”‚
โ”‚  Returns the user from the directory.                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The PAM types

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  auth     โ†’ verify identity (password, token, biometrics)   โ”‚
โ”‚  account  โ†’ check validity (expiry, time, host)             โ”‚
โ”‚  password โ†’ change the password                             โ”‚
โ”‚  session  โ†’ set up/tear down (home dir, limits, variables)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The control flags

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  required   โ†’ must succeed, failure deferred                โ”‚
โ”‚  requisite  โ†’ must succeed, failure immediate               โ”‚
โ”‚  sufficient โ†’ success skips rest                            โ”‚
โ”‚  optional   โ†’ no effect on outcome                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Summary

ItemValue
Domain weight10%
Competency 1Connect to an external authentication source
Competency 2Configure advanced PAM
External source toolssssd, authselect, nsswitch.conf
PAM location/etc/pam.d/
PAM typesauth, account, password, session
PAM control flagsrequired, requisite, sufficient, optional
Verificationgetent passwd, id, sssctl user-checks

Key takeaways:

  • The domain is about external identity, not local accounts. The LFCE tests the client side of an LDAP or Kerberos integration, not useradd. The sssd daemon is the modern client that provides the NSS and PAM integration.
  • nsswitch.conf routes the lookups. The passwd, group, and shadow lines must include sss for the directory users to be visible. Without the routing, the directory is configured but unused.
  • PAM is the authentication stack. Each service has its own file in /etc/pam.d/. The stack is ordered, and the control flags determine what happens when a module succeeds or fails. The pam_sss module is what connects PAM to the directory.
  • The advanced PAM configurations are the ones that change behavior. pam_faillock locks accounts after failed attempts. pam_mkhomedir creates the home directory on first login. pam_access restricts access by host or user. These are the modules that the “advanced” part of the competency refers to.
  • A PAM mistake can lock out every user, including root. Test the configuration in a separate terminal before closing the current session. Keep a root shell open until the change is verified.

Remember: Domain 3 is the identity layer. The external source is the data store, and PAM is the mechanism that queries it. The sssd daemon connects the two, and nsswitch.conf routes the lookups. The advanced PAM modulesโ€”pam_faillock, pam_mkhomedir, pam_accessโ€”are the ones that change the login behavior. Practice the configuration on a test system, verify with getent and sssctl, and always test a PAM change in a separate terminal before committing it.

Was this helpful?


Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!