LFCE 157 ๐ง LFCE Exam Objectives Review โ Domain 3
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
| Competency | Tools |
|---|---|
| External authentication source | sssd, authselect, nsswitch.conf |
| Advanced PAM | /etc/pam.d/, pam_faillock, pam_mkhomedir, pam_access |
SSSD configuration
| Section | Purpose |
|---|---|
[sssd] | Domains and services |
[domain/<name>] | Provider, URI, search base |
id_provider | Identity lookup backend |
auth_provider | Authentication backend |
NSS configuration
| Database | Service |
|---|---|
passwd | files sss |
group | files sss |
shadow | files sss |
PAM module types
| Type | Purpose |
|---|---|
auth | Verify identity |
account | Check account validity |
password | Change password |
session | Set up/tear down session |
PAM control flags
| Flag | Behavior |
|---|---|
required | Must succeed; failure deferred |
requisite | Must succeed; failure immediate |
sufficient | Success skips rest |
optional | Success 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
| Pitfall | Why It Happens | Fix |
|---|---|---|
| Directory user cannot log in | nsswitch.conf not updated | Add sss to passwd, group, shadow |
| SSSD does not start | Wrong permissions on sssd.conf | chmod 600 /etc/sssd/sssd.conf |
| PAM change locks out root | Misordered stack | Boot rescue, revert the change |
| Home directory not created | pam_mkhomedir missing | Add the session module |
| Failed attempts not locked | pam_faillock missing | Add 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
| Item | Value |
|---|---|
| Domain weight | 10% |
| Competency 1 | Connect to an external authentication source |
| Competency 2 | Configure advanced PAM |
| External source tools | sssd, authselect, nsswitch.conf |
| PAM location | /etc/pam.d/ |
| PAM types | auth, account, password, session |
| PAM control flags | required, requisite, sufficient, optional |
| Verification | getent 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. Thesssddaemon is the modern client that provides the NSS and PAM integration. nsswitch.confroutes the lookups. Thepasswd,group, andshadowlines must includesssfor 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. Thepam_sssmodule is what connects PAM to the directory. - The advanced PAM configurations are the ones that change behavior.
pam_faillocklocks accounts after failed attempts.pam_mkhomedircreates the home directory on first login.pam_accessrestricts 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.
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!