From 104d40e8191bbc39185253d445cb52fb460a605d Mon Sep 17 00:00:00 2001 From: KiekerJan Date: Sat, 31 Jul 2021 21:42:57 +0200 Subject: [PATCH] add alternative sshd port to ssh jail --- setup/system.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup/system.sh b/setup/system.sh index 40d17087..b7ed1317 100755 --- a/setup/system.sh +++ b/setup/system.sh @@ -364,9 +364,11 @@ if [ ! -z "$SSH_PORT" ]; then if [ "$SSH_PORT" != "22" ]; then # Add alternative SSH port sed -i "s/port[ ]\+=[ ]\+ssh$/port = ssh,$SSH_PORT/g" /etc/fail2ban/jail.conf + sed -i "s/port[ ]\+=[ ]\+ssh$/port = ssh,$SSH_PORT/g" /etc/fail2ban/jail.d/geoipblock.conf else # Set SSH port to default sed -i "s/port[ ]\+=[ ]\+ssh/port = ssh/g" /etc/fail2ban/jail.conf + sed -i "s/port[ ]\+=[ ]\+ssh/port = ssh/g" /etc/fail2ban/jail.d/geoipblock.conf fi fi