Interview Prep/Linux/SSH & Access Hardening

How do you limit brute-force at the PAM level?

IntermediateProductionSSH & Access Hardening
Answer

pam_faillock (RHEL 8+, also Ubuntu 22.04+) locks accounts after repeated failures.

# /etc/security/faillock.conf
deny = 5
unlock_time = 900
fail_interval = 900

On RHEL enable with authselect enable-feature with-faillock. Check and reset with faillock --user alice and faillock --user alice --reset. Be careful: this can be used to lock out a known admin account, so combine it with SSH keys.

All Linux questions Roadmap: Linux

More on SSH & Access Hardening