[Samba] Samba and ufw

Reindl Harald h.reindl at thelounge.net
Mon Feb 11 17:28:27 UTC 2019



Am 11.02.19 um 17:35 schrieb Martin McGlensey via samba:
> Louis,
> 
> Followed your instructions so far. Take a look at the output of the
> various steps. I'm down to removing items form /etc/ufw. I'm not sure
> what I should delete. I know some of the files are backups generated
> after some rules were deleted. Please tell me what is safe to delete
> before I procede further.
> 
> martin at radio:~$ sudo apt-get remove --purge ufw gufw
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> The following packages were automatically installed and are no longer
> required:
>   libqt5positioning5 libqt5qml5 libqt5quick5 libqt5sensors5

frankly why don#t you throw away all that crap and start write a
"iptables.sh" which is even for a datacenter firewall doing NAT and
firewalling in front of a /24 network no rocket science

also looking what rules are currently active is a no-brainer

[root at firewall:~]$  cat /usr/local/bin/firewall_status
#!/bin/bash

IPTABLES="/sbin/iptables"
DEFAULT_COLOR_START="\e[36m"
DEFAULT_COLOR_STOP="\e[0m"

function firewall_status
{
 # Ausgabemodus
 if [ "$1" != "short" ]; then
  VERBOSE="--verbose"
 fi
 # Alle geladenen Tabellen sortiert durchlaufen
 for table in `cat /proc/net/ip_tables_names | sort`
 do
  echo -e
"${DEFAULT_COLOR_START}---------------------------------------------------------------------------------------${DEFAULT_COLOR_STOP}"
  echo -e "${DEFAULT_COLOR_START}`echo $table: | tr a-z
A-Z`${DEFAULT_COLOR_STOP}"
  echo -e
"${DEFAULT_COLOR_START}---------------------------------------------------------------------------------------${DEFAULT_COLOR_STOP}"
  $IPTABLES -t "$table" --list --numeric --line-numbers $VERBOSE
  echo ""
 done
}

if [ -t 1 ];
then
 firewall_status "$1" | less -R
else
 firewall_status "$1" | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g"
fi



More information about the samba mailing list