Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add faillock configuration to common-auth #145

Merged
merged 1 commit into from
Jun 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/password
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function f_password {
sed -i 's/^# deny.*/deny = 5/' "$FAILLOCKCONF"
sed -i 's/^# fail_interval.*/fail_interval = 900/' "$FAILLOCKCONF"
sed -i '/pam_tally.*/d' "$COMMONACCOUNT"
sed -i 's/auth.*pam_unix.so/auth required pam_faillock.so preauth\nauth [success=1 default=ignore] pam_unix.so\nauth [default=die] pam_faillock.so authfail\nauth sufficient pam_faillock.so authsucc\n/' "$COMMONAUTH"
fi
if ! grep faillock "$COMMONACCOUNT"; then
echo 'account required pam_faillock.so' >> "$COMMONACCOUNT"
Expand All @@ -35,7 +36,7 @@ function f_password {
sed -i '/pam_tally/d' "$COMMONACCOUNT"
fi
if ! grep tally2 "$COMMONACCOUNT"; then
echo 'account required pam_tally2.so' >> "$COMMONACCOUNT"
sed -i '/^$/a account required pam_tally2.so' "$COMMONACCOUNT"
fi
fi

Expand Down