Do I absolutely NEED antivirus or a firewall for xubuntu?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
yeah, use a firewall. Here's a simple one that should work:
Code:
iptables -F
iptables -X
#if you get an ip from a dhcp server
DHCP_SERVER="your_dhcp_server"
#drop everything first
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
#INPUT RULES
iptables -A INPUT -p ALL -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p ALL -i lo -j ACCEPT
iptables -A INPUT -p udp -s $DHCP_SERVER --sport 67, --dport 68 -j -i eth0 -j ACCEPT
iptables -A INPUT -p ALL -j LOG --log-prefix "DROPPED_IN "
#OUTPUT
iptables -A OUTPUT -p ALL -o lo -j ACCEPT
#browse web
iptables -A OUTPUT -p tcp --dport 80 -o eth0 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 443 -o eth0 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 21 -o eth0 -j ACCEPT
iptables -A OUTPUT -p ALL -j LOG --log-prefix "DROPPED_OUT "
Of course, If you don't use dhcp, you don't need the dchp rule, and if you're on wireless you'd most likely change eth0 to eth1 or wlan0
Save it as "firewall", chmod 777 firewall, and ./firewall to run it.
Last edited by dividingbyzero; 01-27-2009 at 01:01 AM.
yeah, use a firewall. Here's a simple one that should work:
Code:
iptables -F
iptables -X
#if you get an ip from a dhcp server
DHCP_SERVER="your_dhcp_server"
#drop everything first
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
#INPUT RULES
iptables -A INPUT -p ALL -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p ALL -i lo -j ACCEPT
iptables -A INPUT -p udp -s $DHCP_SERVER --sport 67, --dport 68 -j -i eth0 -j ACCEPT
iptables -A INPUT -p ALL -j LOG --log-prefix "DROPPED_IN "
#OUTPUT
iptables -A OUTPUT -p ALL -o lo -j ACCEPT
#browse web
iptables -A OUTPUT -p tcp --dport 80 -o eth0 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 443 -o eth0 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 21 -o eth0 -j ACCEPT
iptables -A OUTPUT -p ALL -j LOG --log-prefix "DROPPED_OUT "
Of course, If you don't use dhcp, you don't need the dchp rule, and if you're on wireless you'd most likely change eth0 to eth1 or wlan0
Save it as "firewall", chmod 777 firewall, and ./firewall to run it.
Too restrictive. This rule will disable everything except http, https and ftp. By everything I mean pop3, all p2p, icq (unless passed through https tunnel), every network game, and so on. For original poster it would be better to study iptables manual (which won't be easy), or (better idea for novice ubuntu user) find info about ubuntu built-in graphical firewall tools (it is bound to have them). I think it would be easier just to allow all outgoing connections instead of blocking all output.
And it could handle some DoS attacks. Here is how it is done in my modem (according to modem's settings, entries below jumps to pingflood/synflood chains handle port scanning):
it's not too restrictive. All you have to do is add whatever you want to allow. It's best to drop EVERYTHING and then specifically let through what you need. But, yeah, I agree with you that the OUTBOUND rule could allow all outbound.
Last edited by dividingbyzero; 01-27-2009 at 03:07 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.