Skip to content
Snippets Groups Projects
Commit a686f240 authored by Bob Mottram's avatar Bob Mottram
Browse files

Limit number of login attempts

parent b8b0637e
No related branches found
No related tags found
No related merge requests found
......@@ -381,10 +381,16 @@ function set_max_login_tries {
max_tries=$1
if ! grep ' deny=' /etc/pam.d/common-auth; then
sed -i "/pam_deny.so/a auth required pam_tally2.so onerr=fail unlock_time=1800 deny=$max_tries" /etc/pam.d/common-auth
sed -i "/pam_deny.so/a auth required\t\t\tpam_tally.so onerr=fail no_lock_time per_user deny=$max_tries" /etc/pam.d/common-auth
else
sed -i "s| deny=.*| deny=$max_tries|g" /etc/pam.d/common-auth
fi
if ! grep ' deny=' /etc/pam.d/common-account; then
sed -i '/pam_deny.so/a account required\t\t\tpam_tally.so' /etc/pam.d/common-account
else
sed -i "s| deny=.*| deny=$max_tries|g" /etc/pam.d/common-account
fi
}
function setup_firewall {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment