* '''PAM Modules''': Shared libraries that perform specific authentication tasks, such as verifying passwords or checking account policies. * '''PAM Configuration Files''': Text files located in /etc/pam.d/ that define the authentication policies for various applications. * '''PAM Management Groups''': Categories of management tasks, including `auth`, `account`, `password`, and `session`.
* '''Flexibility''': Administrators can configure and stack multiple authentication methods. * '''Modularity''': Supports a wide range of authentication methods via modular plugins. * '''Centralized Control''': Provides centralized authentication management for different services. * '''Security''': Enhances security by allowing the use of advanced authentication mechanisms like biometrics and multi-factor authentication.
```plaintext auth required pam_env.so auth required pam_unix.so account required pam_nologin.so account required pam_unix.so password required pam_unix.so session required pam_limits.so session required pam_unix.so session optional pam_motd.so ```
* **auth**: Authentication management, ensuring user identity. * **account**: Account management, checking if access is allowed. * **password**: Password management, handling password changes. * **session**: Session management, setting up and tearing down user sessions.
* **pam_unix.so**: Uses traditional Unix authentication, such as checking /etc/passwd and /etc/shadow. * **pam_env.so**: Sets up user environment variables. * **pam_tally2.so**: Tracks login attempts and can lock accounts after too many failed attempts. * **pam_motd.so**: Displays the message of the day.
* To enable Google Authenticator for SSH: 1. Install the Google Authenticator PAM module. 2. Edit /etc/pam.d/sshd and add: ```plaintext auth required pam_google_authenticator.so ``` 3. Configure SSH to use PAM by editing /etc/ssh/sshd_config and setting: ```plaintext UsePAM yes ```