Fixed UFW defaults for Centos

Fixed selinux ssh port
This commit is contained in:
2020-12-03 11:28:41 +01:00
parent 859033a213
commit a9f57d3513
3 changed files with 14 additions and 3 deletions

View File

@@ -1,7 +1,20 @@
##--------------------##
# (Centos) SeLinux #
##--------------------##
if [ "$shortdist" = "cent8" ]; then
semanage port -a -t ssh_port_t -p tcp 4242
fi
##-------##
# UFW #
##-------##
if [ "$shortdist" = "cent8" ]; then
sed -i -e '/tuple/d' -e '/dapp/d' /usr/share/ufw/iptables/user.rules
sed -i -e '/tuple/d' -e '/dapp/d' /usr/share/ufw/iptables/user6.rules
echo "y" | ufw reset > $OUTPUT 2>&1
fi
sed -i '/IPV6=/c\IPV6=yes' /etc/default/ufw
ufw default deny incoming > $OUTPUT 2>&1
ufw default allow outgoing > $OUTPUT 2>&1