Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm running a desktop computer, but one with high threat risk.

I've blocked all ports using a firewall except:

HTTP, HTTPS, DNS, one port for torrent client.

Do any common processes in distros like Ubuntu, Linux Mint, Debian use other ports that I need to allow?

share|improve this question
2  
This question is way too broad. What is your system used for? As a firewall, a NAS, a desktop, an embedded system, …? What applicatins are you using? No ports are generally essential. A Linux system works fine without any network connectivity. And ports don't have security risks (except for kernel bugs), but applications do. Open the ports you need and close the remaining ones. –  Marco Jan 26 at 12:26
    
There is no default setting. It strongly depends of what purpose you going to use the machine. –  user55518 Jan 27 at 0:05

2 Answers 2

up vote 2 down vote accepted

In principle, modern firewalls are 'stateful'.

Meaning you don't need to allow anything from outside as it will find out itself which are the answers to requests that you have made and let them in automatically.

So you don't need incoming HTTP or HTTPS, etc. explicitely unless you're hosting a webserver.

However, if you have a port forwarding for your torrent client, you indeed need to allow that, because there is no outgoing connection asking for a reply but indeed a new connection coming in from outside in that case.

In practice it should look more or less like this for starters (look up an iptables tutorial for details):

Chain INPUT (policy DROP)
num  target     prot opt source               destination
1    DROP       all  --  0.0.0.0/0            0.0.0.0/0           state INVALID
2    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
Chain FORWARD (policy DROP)
num  target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

Might be useful to allow ssh port besides a torrent port, but then make sure your ssh password is secure or use keys.

share|improve this answer
    
Thanks for letting me know that. I thought that you had to allow both incoming and outgoing connection for HTTP, HTTPS and DNS. Now changed it. –  Ufoguy Jan 26 at 13:14
    
You're blocking DNS. –  Gilles Jan 26 at 23:21

For a minimalist way of dealing with it:

Check ufw status, as superuser:

ufw status

if disabled, do:

ufw enable

This will block all incoming and allow all outgoing, and should be enough for all desktops.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.