Update 12_install_ufw_rules.sh

This commit is contained in:
ymir1v 2021-06-25 15:43:47 +02:00 committed by GitHub
parent 5aaba04926
commit b27040f0fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,9 +4,14 @@ OURNAME=12_install_ufw_rules.sh
echo -e "\n-- Executing ${ORANGE}${OURNAME}${NC} subscript --" echo -e "\n-- Executing ${ORANGE}${OURNAME}${NC} subscript --"
#### UFW #### # get sshd port from /etc/ssh/sshd_config
_var_sshd_port="$(cat /etc/ssh/sshd_config|grep -i -E ^port|cut -f2 -d' ')"
if [[ $_var_sshd_port == "" ]]; then
_var_sshd_port=22
fi
ufw allow 22/tcp #### UFW ####
ufw allow $_var_sshd_port/tcp
ufw allow 80/tcp ufw allow 80/tcp
ufw allow 443/tcp ufw allow 443/tcp
ufw allow 25/tcp ufw allow 25/tcp