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.
More on SSH & Access Hardening
What are the first sshd_config changes you make on a new production server?BeginnerWhy use a drop-in file in /etc/ssh/sshd_config.d/ instead of editing sshd_config?IntermediateWhy disable SSH password authentication entirely?BeginnerShould you change the SSH port from 22?IntermediateWhat are SSH certificates and why do large fleets use them?AdvancedHow do you restrict what a specific SSH key can do?Advanced