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 # # 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 sed -i '/IPV6=/c\IPV6=yes' /etc/default/ufw
ufw default deny incoming > $OUTPUT 2>&1 ufw default deny incoming > $OUTPUT 2>&1
ufw default allow outgoing > $OUTPUT 2>&1 ufw default allow outgoing > $OUTPUT 2>&1

View File

@@ -1 +1 @@
cronie cronie policycoreutils-python-utils

View File

@@ -1,4 +1,3 @@
echo "DEBUG Start preconf"
if [ "$shortdist" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ] ; then if [ "$shortdist" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ] ; then
######################## ########################
# Debian/Ubunbtu # # Debian/Ubunbtu #
@@ -36,7 +35,6 @@ elif [ "$shortdist" = "cent8" ]; then
################ ################
# Centos # # Centos #
################ ################
echo "DEBUG running cent8 preconf"
##--------------## ##--------------##
# Repositories # # Repositories #
##--------------## ##--------------##