Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Is likely to be useless. The SSH server is listening on port 22, but you really have no idea what port the SSH client is using. It may very well not be port 22. I'm guessing that all the other stuff your dropping is causing the problem. I'm guessing that since you're dropping all sorts of syn packets, that is preventing SSH from working properly. Believe it or not, syn packets are required for TCP/IP to work, so dropping random port ranges is probably not a good idea.
-A RH-Lokkit-0-50-INPUT -p tcp --dport 22 -j ACCEPT
and after I restart iptables, I got following results:
# service iptables restart
Flushing all current rules and user defined chains: [ OK ]
Clearing all current rules and user defined chains: [ OK ]
Applying iptables firewall rules: iptables-restore v1.2.7a: no command specified
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
I'm not sure what tool you would use to modify your firewall (posting your distro might help) but you're probably looking for a firewall that looks something like this:
iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
This firewall is oversimplified, but maybe it will help you see where to go. Notice that the table defaults are all set to DROP. Then I've allowed ESTABLISHED and RELATED packets in. That allows returned packets from any process originating on my machine to come back. The OUTPUT chain is pretty wide open.
The port 22 rule should let in SSH traffic (it would be NEW, so it would fail the ESTABLISHED and RELATED input rule) and the existing OUTPUT would let the traffic back out.
I really think that your existing firewall is a mess, and it is likely causing problems. If I were in your shoes, I would ditch it entirely and get one in place that you do understand.
I gather that you're using some flavor of Red Hat/Fedora and I believe that their firewall is controlled by some GUI tool. How did you get your existing firewall? It doesn't look like a default set of rules, so the same way you created this one should let you create a better set of rules. Knowing what distro you're actually using might help us point you in the right direction.
And you're trying to use this as a server exposed to the Internet???????????
A piece of friendly advice: Ditch this distro NOW if not sooner. RH9 has not had any support for a number of years, and there are many, many, many security holes in it. All you're doing with this box is making some botnet owner very happy because they will have another easy-to-crack machine available.
Ah, good. As a learning tool, RH9 is probably OK. I'd still give some thought to grabbing a newer distro as RH9 is pretty dated.
If you don't know or can't find the RH9 firewall GUI tool, you could always write your own firewall script and then run that. As long as you run it at the end of the RH9 boot, it should replace the default firewall.