From 28c1c9b18553a7867ca1b7d6daede2b955acdd16 Mon Sep 17 00:00:00 2001 From: yuriy0803 <68668177+yuriy0803@users.noreply.github.com> Date: Sun, 10 Dec 2023 16:46:18 +0100 Subject: [PATCH] Update install.sh --- install.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 0413016..127c091 100644 --- a/install.sh +++ b/install.sh @@ -7,8 +7,15 @@ echo "Welcome to the installation!" # Update and upgrade the package list sudo apt-get update && sudo apt-get upgrade -y -# Install npm, rsync, git, redis-server, and nginx -sudo apt-get install npm rsync git ipset redis-server nginx -y +# Install npm, rsync, git, redis-server, nginx, and fail2ban +sudo apt-get install npm rsync git ipset redis-server nginx fail2ban -y + +# Configure Fail2Ban for SSH +sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local +sudo sed -i '/^\[sshd\]$/a enabled = true\nmaxretry = 3\nfindtime = 600\nbantime = 3600' /etc/fail2ban/jail.local + +# Restart Fail2Ban to apply changes +sudo systemctl restart fail2ban sudo ipset create blacklist hash:ip