whatis pam

PAM

Also known as: Pluggable Authentication Modules

Pluggable Authentication Modules, the framework Linux programs use to handle logins, passwords, 2FA, and session setup.

What Is PAM in Linux?

Programs like login, sshd, sudo, and display managers do not check passwords themselves. They call PAM, which runs the stack of modules configured in /etc/pam.d/<service>.

Adding a module lets you require TOTP codes, lock accounts after failed attempts, enforce password quality, or create home directories on first login, without changing the programs.

Example

cat /etc/pam.d/sshd