Linux - General This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
01-26-2009, 06:20 PM
|
#1
|
LQ Newbie
Registered: Jan 2009
Distribution: Xubuntu
Posts: 12
Rep:
|
Do I absolutely NEED antivirus or a firewall for xubuntu?
Just wondering because I'm using to having those from xp.
|
|
|
01-26-2009, 06:44 PM
|
#2
|
Senior Member
Registered: Dec 2005
Distribution: Slackware
Posts: 1,135
|
Yes to firewall, unless provided by router.
No (with all due respect to security guru unSpawn, et al) antivirus UNLESS you will be forwarding emails with attachments to Windows users.
Browse this thread for some thoughts (on both sides) on the antivirus issue:
Code:
http://www.linuxquestions.org/questions/linux-general-1/what-anti-virus-software-do-you-use-699576/
cheers,
|
|
|
01-26-2009, 07:04 PM
|
#3
|
Member
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661
Rep:
|
yeah was a good theard looks like a religion discussion lol
|
|
|
01-27-2009, 12:57 AM
|
#4
|
Member
Registered: May 2008
Location: Earth
Distribution: Slackware 12.2
Posts: 52
Rep:
|
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.
|
|
|
01-27-2009, 01:43 AM
|
#5
|
Senior Member
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Rep:
|
Quote:
Originally Posted by dividingbyzero
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):
Code:
#iptables -vnL
....
Chain INPUT (policy ACCEPT 228 packets, 13616 bytes)
pkts bytes target prot opt in out source destination
0 0 pingflood icmp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 icmp type 8 state NEW
0 0 synflood tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 state NEW
0 0 DROP tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x03/0x03
0 0 DROP tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x06/0x06
0 0 DROP tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x3F/0x00
0 0 DROP tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x3F/0x37
0 0 DROP tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x3F/0x29
....
Chain pingflood (2 references)
pkts bytes target prot opt in out source destination
0 0 RETURN icmp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 icmp type 8 limit: avg 1/sec burst 5
0 0 REJECT icmp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
Chain synflood (2 references)
pkts bytes target prot opt in out source destination
0 0 RETURN tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 limit: avg 15/sec burst 25
0 0 REJECT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 reject-with tcp-reset
Last edited by ErV; 01-27-2009 at 01:48 AM.
|
|
|
01-27-2009, 03:04 AM
|
#6
|
Member
Registered: May 2008
Location: Earth
Distribution: Slackware 12.2
Posts: 52
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 09:06 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|