Course contentsShow
← Linux
Lesson 819 of 1,8198. User Management and Pluggable Authentication ModulesFree lesson

Understanding the Four Management Groups

You will distinguish between auth, account, password, and session PAM modules to modularize security.

In this lesson, you will learn how Pluggable Authentication Modules (PAM) divide the complex process of user login into four distinct management groups to provide modular security.

When you attempt to log into a Linux system, the OS doesn't just "check a password." It executes a sequence of tasks governed by configuration files in /etc/pam.d/. These tasks are categorized into four specific management groups, each responsible for a unique phase of the authentication workflow.

The Four Management Groups

  1. auth (Authentication): This is the verification stage. Its primary purpose is to confirm that the user is who they claim to be. This group handles checking passwords, prompting for multi-factor authentication (MFA) tokens, or verifying biometric input.
  2. account (Account Management): Once the user is verified, the system needs to determine if they are allowed to log in. This group checks non-authentication conditions, such as whether the account has expired, if it is currently locked, or if the user is attempting to log in during restricted hours.
  3. password (Password Management): This group is responsible for updating or changing authentication tokens. When you run the passwd command, this management group is invoked to enforce policies like password complexity, length requirements, and historical reuse prevention.
  4. session (Session Management): This group handles the "bookends" of a user session. It performs tasks that must occur before a user gains access (like mounting home directories or logging the login event) and tasks that must occur after the user logs out (like cleaning up temporary files or unmounting drives).

Example Configuration Snippet

In a file like /etc/pam.d/sshd, you will see these groups explicitly labeled:

auth     required    pam_unix.so
account  required    pam_nologin.so
password requisite   pam_pwquality.so
session  optional    pam_motd.so

By decoupling these tasks, Linux allows administrators to swap out authentication methods—like moving from local password files to LDAP or Kerberos—without changing the logic for session management or account expiration. Each group acts as a modular "gatekeeper" in the lifecycle of a user login.

Key Takeaway: PAM modularizes security by splitting the user lifecycle into four specific functional phases—authentication, account validation, password maintenance, and session management—allowing for independent and flexible configuration of each.