From 97cd782b70c8baaf94203b2fdd13eee5644e5584 Mon Sep 17 00:00:00 2001 From: Molly Lau Date: Mon, 25 Sep 2023 00:25:08 +0900 Subject: [PATCH] Update InstallNET.sh --- Linux_reinstall/InstallNET.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Linux_reinstall/InstallNET.sh b/Linux_reinstall/InstallNET.sh index 3557e66..ae8a08e 100644 --- a/Linux_reinstall/InstallNET.sh +++ b/Linux_reinstall/InstallNET.sh @@ -3862,9 +3862,10 @@ sed -ri "/^#?PasswordAuthentication.*/c\PasswordAuthentication yes" /etc/ssh/ssh # Change ssh port sed -ri "/^#?Port.*/c\Port ${sshPORT}" /etc/ssh/sshd_config -rm -rf /etc/firewalld/zones/public.xml -wget --no-check-certificate -qO /etc/firewalld/zones/public.xml '$FirewallRule' -sed -ri 's/port=""/port="${sshPORT}"/g' /etc/firewalld/zones/public.xml + +# Add new ssh port for firewalld +sed -i '6i \ \ ' /etc/firewalld/zones/public.xml +sed -i '7i \ \ ' /etc/firewalld/zones/public.xml firewall-cmd --reload # Write fail2ban config