How to lock users after 5 unsuccessful login tries?
I gathered a few distributions/versions to how to do it, but I can't test it.
RHEL4: by adding the:
auth required /lib/security/$ISA/pam_tally.so no_magic_root
account required /lib/security/$ISA/pam_tally.so deny=5 reset no_magic_root
to:
/etc/pam.d/system-auth
/etc/pam.d/login
/etc/pam.d/sshd
RHEL4: ???
SLES9: by adding the:
auth required pam_tally.so no_magic_root
account required pam_tally.so deny=5 reset no_magic_root
to:
/etc/pam.d/login
/etc/pam.d/sshd
SLES11 or SLES10: by adding the:
auth required pam_tally.so deny=5 onerr=fail per_user no_lock_time
to:
/etc/pam.d/common-auth
AND by adding the:
account required pam_tally.so
to:
/etc/pam.d/common-account
QUESTION: Can someone please confirm it that this is the working/good way to lock users after 5 unsuccessful login tries? OR HOW TO DO THIS?
p.s.:
/sbin/pam_tally --user USERNAME --reset
is a usefull thing to do before doing this? Can I lock out the root user with these? Editing PAM is a very sensitive thing, because People could lock out themselves from the server (I'm meaning ex.: the root user). Any hints when doing this?