mirror of
https://github.com/leitbogioro/Tools.git
synced 2024-11-15 13:44:50 +08:00
Update InstallNET.sh
This commit is contained in:
parent
f760cb3363
commit
97cd782b70
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue