LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Can firewall and ssh co-exist in RedHat 9.0? (https://www.linuxquestions.org/questions/linux-security-4/can-firewall-and-ssh-co-exist-in-redhat-9-0-a-324901/)

adamliu 05-19-2005 12:57 AM

Can firewall and ssh co-exist in RedHat 9.0?
 
Hi,

In redHat 9.0, When I use ssh to connect another server, it seems the firewall must be stopped.
My question is--
Is it possible to use ssh without closing firewall?How?
Is the firewall still needed or not if ssh connection is used?



Thanks.

mcosta 05-19-2005 02:16 AM

You need to tell to the firewall to open the port 22. Sure red hat has a GUI for that. Anyway the command to do that is:

iptables -A INPUT -i eth0 -m tcp -p tcp -dport 22 -j ACCEPT

Please note rebooting clears the firewall config, so I recommend you to use the GUI.

ilnli 05-20-2005 03:55 AM

place this rule at the top of the chain

iptables -I INPUT 1 -i eth0 -m tcp -p tcp -dport 22 -j ACCEPT

Capt_Caveman 05-20-2005 10:10 AM

Slight syntax errors in the above rules that will keep them from loading. Should be --dport not -dport, like this:

iptables -I INPUT 1 -i eth0 -m tcp -p tcp --dport 22 -j ACCEPT


All times are GMT -5. The time now is 03:01 AM.