Update InstallNET.sh

This commit is contained in:
Molly Lau 2023-09-25 00:25:08 +09:00 committed by GitHub
parent f760cb3363
commit 97cd782b70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 \ \ <port port="${sshPORT}" protocol="tcp"/>' /etc/firewalld/zones/public.xml
sed -i '7i \ \ <port port="${sshPORT}" protocol="udp"/>' /etc/firewalld/zones/public.xml
firewall-cmd --reload
# Write fail2ban config