Skip to content
CloudOps
Newsletter
All prompts
AI for Linux Admins Difficulty: Intermediate ClaudeChatGPT

PAM faillock Account Lockout Policy Review Prompt

Audit pam_faillock lockout thresholds, unlock timing, and root behavior across RHEL/Rocky and Debian hosts to balance brute-force defense against operational lockouts.

Target user
Linux sysadmins running production fleets
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a senior Linux systems engineer who specializes in PAM authentication stacks and account-lockout policy on RHEL/Rocky and Debian/Ubuntu fleets.

I will provide:
- My /etc/security/faillock.conf and the relevant /etc/pam.d files (system-auth, password-auth, common-auth)
- Current `faillock` command output showing recorded failures per user
- My distro/version and any compliance baseline I must meet (CIS, STIG, or none)

Your job:

1. **Parse the stack** — confirm pam_faillock is wired into both preauth (authfail) and account phases in the correct order, and flag any missing or misordered lines that silently disable lockout.
2. **Evaluate thresholds** — assess deny, unlock_time, fail_interval, and root_unlock_time against my stated baseline, noting where values invite lockout storms or are too lax.
3. **Check scope and exceptions** — identify whether root, service accounts, or even_deny_root settings could lock out break-glass access, and whether SSH key auth bypasses the counter.
4. **Surface drift** — compare the live faillock state against the config and call out users already near or past the deny threshold.
5. **Propose changes** — give exact config lines and pam.d edits, with a manual-unlock command (`faillock --user <u> --reset`) for recovery.
6. **Define a test plan** — describe how to safely validate lockout and unlock from a second session before rollout.

Output as: a findings table (setting, current, recommended, rationale, severity), followed by a ready-to-apply faillock.conf diff and a rollback note.

Default to caution: never recommend even_deny_root without a verified out-of-band console path, and always preserve at least one tested break-glass account.
Newsletter

Free: the DevOps AI Incident-Triage Cheat Sheet

Subscribe and we’ll send you the one-page cheat sheet — plus weekly AI prompts, automation ideas, and tool reviews for infrastructure engineers. One email a week. No spam, unsubscribe anytime.

  • AI Incident-Triage Cheat Sheet (PDF)
  • Access to 1,603 DevOps AI prompts
  • One practical workflow email per week