Created
September 9, 2020 07:04
-
-
Save hkhoshraftar/354ec4e8f04dc49f2e6cdedc2504043c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum install epel-release -y | |
yum install fail2ban nano -y | |
systemctl enable fail2ban | |
cat <<EOF > /etc/fail2ban/jail.local | |
[DEFAULT] | |
# Ban hosts for one hour: | |
bantime = 3600 | |
# Override /etc/fail2ban/jail.d/00-firewalld.conf: | |
banaction = iptables-multiport | |
[sshd] | |
enabled = true | |
[nginx-http-auth] | |
enabled = true | |
EOF | |
systemctl restart fail2ban | |
fail2ban-client status | |
fail2ban-client status sshd | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment