Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Simple IPTables script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Deranger
Veteran
Veteran


Joined: 26 Aug 2004
Posts: 1215

PostPosted: Mon Sep 06, 2004 6:17 am    Post subject: Simple IPTables script Reply with quote

<removed>

Last edited by Deranger on Tue Oct 12, 2004 2:50 pm; edited 9 times in total
Back to top
View user's profile Send private message
Leprechaun
n00b
n00b


Joined: 04 Oct 2003
Posts: 49
Location: Minnesota, USA

PostPosted: Mon Sep 06, 2004 4:06 pm    Post subject: Reply with quote

Check out <a href=" http://www.gentoo.org/doc/en/gentoo-security.xml">this</a> (Gentoo Security Guide) for some ideas. I use some of the things in there, but most are either not necessary with my setup or haven't been implemented because of laziness.

One handy way of securing ssh further is to use RSA authentication and disallow passwords. Mind you this only really works if you have some sort of portable media; I put my rsa key on my usb keychain.

I don't have a whole lot of experience with iptables, but the ruleset is going to be dependant on what sort of setup you have. Do you want to be able to log in from any machine? Just your local network? Just one specific machine? The more limited you want/need your service to be, the more you can lock down access to the machine with iptables.

Another toy to look at is port knocking. Unfortunately I haven't set this up on my server, so I can't give you any first-hand advice. Basically, port knocking is a technique which allows you to remain closed off to the world (no open ports) until you receive a special "knock" (request ports 1000, 1005, 1002, 1002, 1003 in that order or something). Upon receiving the knock, the desired port (22 for ssh) opens and you can attempt to authenticate with ssh. Note that this does not bypass the ssh authentication, it's just another layer on top of it.

Hope those help to give you a bit of a starting point. :)
Back to top
View user's profile Send private message
Deranger
Veteran
Veteran


Joined: 26 Aug 2004
Posts: 1215

PostPosted: Mon Sep 13, 2004 8:28 pm    Post subject: Reply with quote

So, what do you think of that IPTables script? I don't need any high-end security but simple script that increases security of my box.
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Mon Sep 13, 2004 8:37 pm    Post subject: Reply with quote

Quote:
Only service I need running is SSHD.


Why are you allowing web? Do you have a web server too?

Quote:
# Allow WWW traffic
iptables -A INPUT -i ${EXT_NIC} --protocol tcp --destination-port 80 -j ACCEPT
iptables -A INPUT -i ${EXT_NIC} --protocol tcp --destination-port 443 -j ACCEPT


I would also get some logging in there.

Code:
iptables -A INPUT -j LOG --log-prefix "FW_INPUT  "


hanji
Back to top
View user's profile Send private message
Deranger
Veteran
Veteran


Joined: 26 Aug 2004
Posts: 1215

PostPosted: Mon Sep 13, 2004 9:00 pm    Post subject: Reply with quote

hanj wrote:

Why are you allowing web? Do you have a web server too?

No, I'm not running web-server and I just realized that I don't need to allow incoming traffic to port 80 and 443 :oops:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum