View previous topic :: View next topic |
Author |
Message |
Deranger Veteran
Joined: 26 Aug 2004 Posts: 1215
|
Posted: Mon Sep 06, 2004 6:17 am Post subject: Simple IPTables script |
|
|
<removed>
Last edited by Deranger on Tue Oct 12, 2004 2:50 pm; edited 9 times in total |
|
Back to top |
|
|
Leprechaun n00b
Joined: 04 Oct 2003 Posts: 49 Location: Minnesota, USA
|
Posted: Mon Sep 06, 2004 4:06 pm Post subject: |
|
|
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 |
|
|
Deranger Veteran
Joined: 26 Aug 2004 Posts: 1215
|
Posted: Mon Sep 13, 2004 8:28 pm Post subject: |
|
|
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 |
|
|
hanj Veteran
Joined: 19 Aug 2003 Posts: 1500
|
Posted: Mon Sep 13, 2004 8:37 pm Post subject: |
|
|
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 |
|
|
Deranger Veteran
Joined: 26 Aug 2004 Posts: 1215
|
Posted: Mon Sep 13, 2004 9:00 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
|