Created
May 13, 2021 17:59
-
-
Save johnstanfield/213ab7d58d585f3adce25cd16d053676 to your computer and use it in GitHub Desktop.
install fail2ban on amazon linux 2
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
# run as root or sudo everything below | |
# install epel | |
amazon-linux-extras install epel -y | |
# install fail2ban | |
yum -y install fail2ban | |
# configure fail2ban (just adding enabled=true in the sshd section) | |
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local | |
sed -i "s/^\[sshd\]/[sshd]\nenabled=true/" /etc/fail2ban/jail.local | |
# profit | |
systemctl restart fail2ban |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this!
It may be good to add
To ensure it starts up on reboot 😄