Fixed fail2ban and replaced cent8 with el8
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
##----------##
|
||||
# Centos #
|
||||
##----------##
|
||||
if [ "$shortdist" = "cent8" ]; then
|
||||
if [ "$shortdist" = "el8" ]; then
|
||||
#SeLinux
|
||||
semanage port -a -t ssh_port_t -p tcp 4242
|
||||
systemctl enable ufw > $OUTPUT 2>&1
|
||||
@@ -14,7 +14,7 @@ fi
|
||||
# UFW #
|
||||
##-------##
|
||||
|
||||
if [ "$shortdist" = "cent8" ]; then
|
||||
if [ "$shortdist" = "el8" ]; then
|
||||
sed -i -e '/tuple/d' -e '/dapp/d' /usr/share/ufw/iptables/user.rules
|
||||
sed -i -e '/tuple/d' -e '/dapp/d' /usr/share/ufw/iptables/user6.rules
|
||||
echo "y" | ufw reset > $OUTPUT 2>&1
|
||||
@@ -42,6 +42,15 @@ curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fai
|
||||
curl --retry 7 --retry-delay 5 -s https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-hard.conf -o /etc/fail2ban/filter.d/wordpress-hard.local
|
||||
curl --retry 7 --retry-delay 5 -s https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-soft.conf -o /etc/fail2ban/filter.d/wordpress-soft.local
|
||||
|
||||
if [ "$shortdist" = "el8" ]; then
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Filters/action.d/ufw.conf -o /etc/fail2ban/action.d/ufw.conf
|
||||
ln -s /var/log/secure /var/log/auth.log
|
||||
fi
|
||||
|
||||
#Start fail2ban service
|
||||
systemctl start fail2ban
|
||||
systemctl enable fail2ban
|
||||
|
||||
#General jails
|
||||
rm /etc/fail2ban/jail.d/*
|
||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Jails/sshd.jail -o /etc/fail2ban/jail.d/sshd.local
|
||||
|
||||
Reference in New Issue
Block a user