We recently had a server root level hacked.
Migrating to two new servers, and I need to learn basic IPTABLES real
fast to help prevent more attacks.
I read, well, tried to read "man iptables", but I actually need
something one step more basic and "for dummies" than that. Looks like a
good resource for after I know the basics.
For example, I'm not even quite sure I get where to edit the iptables
in the first place! (RedHat ES2).
I did a newsgroup search, but I see a lot of posting asking specific
questions that assume knowledge of the very basics, which I know
nothing of.
For example, in threads like this:
http://groups.google.com/group/alt.o...db70a2382bbd9e
people post bits of IPTABLES, but I can't quite get how they even got
that display.
When I
# iptables -L
I get something that looks quite different.
Looking an an example like:
#Allow SMTP
iptables -A OUTPUT -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -p tcp --sport 25 -j ACCEPT
I get that it's setting up a condition of incoming and outgoing TCP
port packets through port 25 should be accepted, and I'm guessing if I
replaced ACCEPT with DENY, that's prevent any packets from getting to
port 25.
But, I can't find how to do something like:
DROP _all_ packets by default, except for the SSH port when coming from
a specific IP address.
(Or would blocking ALL traffic in/out of a server save for ONLY two IP
addresses allowed to access it, be controlled in something like the
HOSTS file?
In any case, for the other server I would want to DROP all except 80
and 443... )
In any case, need some kind of tutorial explaining IPTABLES for the
COMPLETE beginner, and not for someone who already understands the MAN
reasonably well.
Thanks for any feedback!
Liam