Lion Cipher Lab

Set a strong password policy with PAM on your own Linux machine

Why it matters

Almost every intrusion that does not involve a fresh software flaw begins the same dull way: someone logs in with a password an attacker guessed, reused, or found in a leak. A password policy is the set of rules that makes that far harder -- how strong a password has to be before the system will accept it, how long it can be used before it must change, and how many wrong guesses an attacker gets before the account slams shut. On Linux, all three of those rules are enforced in one place: PAM, the Pluggable Authentication Modules framework that every login, `sudo`, and `passwd` on the system…

What you'll learn

Steps in this lab

  1. First: do this on a machine you can afford to break, and keep a rescue session open
  2. Get a free, throwaway Linux environment to practice on (from nothing)
  3. Open a terminal, set up your rescue session, and meet PAM
  4. Password complexity: configure pam_pwquality
  5. TEST it: prove a weak password is actually refused
  6. Password aging: set expiry and change intervals with chage
  7. Account lockout: configure pam_faillock
  8. TEST the lockout, then unlock -- with your rescue rope tied
  9. Reality check: match your policy to modern guidance (NIST 800-63B)
  10. Clean up, make it a habit, and where to take this next

Open the full interactive lab →