Linux PAM & Faillock Policy Generator
Generate production-grade PAM authentication stacks and pam_faillock account lockout policies to defend against brute-force attacks and credential spraying 100% offline.
[ 1. SECURITY PRESET PROFILES ]
[ 2. THRESHOLD & INTERVAL DIRECTIVES ]
# Generating PAM Faillock configuration...
/etc/security/faillock.conf automatically applies to standard PAM stacks without manually editing /etc/pam.d/ files.
Architecture: Linux Pluggable Authentication Modules (PAM) & Faillock
The Linux Pluggable Authentication Modules (PAM) architecture provides dynamic, modular authentication abstraction across SSH, console login, `sudo`, and display managers. pam_faillock replaces the deprecated pam_tally2 module, tracking consecutive failed authentication attempts in transient tally databases under /var/run/faillock/ or /run/faillock/.
Key Security Directives Explained
even_deny_root & root_unlock_time
By default, PAM exempts the root account from lockout to prevent Denial-of-Service (DoS) attacks where an attacker intentionally locks out administrative access. Enabling even_deny_root combined with a dedicated root_unlock_time protects SSH jump hosts from root dictionary brute-force while allowing automated recovery.
silent & User Enumeration Defense
When an account is locked out, PAM can display explicit messages like "Account locked due to 3 failed logins". Enabling the silent directive suppresses these messages, preventing external attackers from identifying which usernames exist on the target system.
Managing Locked Accounts with the faillock CLI
Administrators can inspect and reset authentication tally records instantly without restarting any daemons:
# View authentication failure records for a user:
$ faillock --user devops_admin
# View failure records across all accounts:
$ faillock
# Reset / unlock a specific user account:
$ sudo faillock --user devops_admin --reset
# Reset all locked accounts on the host:
$ sudo faillock --reset