Close ports on Linode Debian
-
Hello all,
I have been trying to figure out what firewall I have on our Debian host but cannot. I did a port scan and found that we have some ports open that I want to close as I know we don't use any of them.
-
Use UFW
apt-get install -y ufw
Then open only what you need to use. Here are examples.
ufw enable ufw allow in ssh ufw allow in http ufw allow in https ufw allow in 10000:20000/udp
-
FYI, this writes to
iptables
for you as far as I know. -
Beyond using a firewall, you can also set whatever ports to simply not be open. Firewalls block ports, but leave them open. You can close them additionally. Your best defense is doing both.
-
By default Debian comes with iptables. It will allowing everything but a normal Debian install have no services running.
Run
iptables -L
to see the firewall rules.On Debian 10 the default is nftables.