LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Allowing ssh ftp through the firewall (https://www.linuxquestions.org/questions/linux-newbie-8/allowing-ssh-ftp-through-the-firewall-202652/)

jmg1894 07-08-2004 12:58 PM

Allowing ssh ftp through the firewall
 
I have a new install of RedHat 9.0 and I believe I blocked myself from being able to ssh and ftp to this new server. How do I reconfigure the firewall to allow ssh and ftp? During the setup I choose the middle setting for the firewall config. thanks

jeffreybluml 07-08-2004 01:11 PM

Here you go...just do this...

# /sbin/iptables -A INPUT -j ACCEPT -m state --state NEW -p tcp --dport 22 --syn

do that as root, and it'll open up port 22, which is the port used for ssh/ftp.

Add the following line to /etc/sysconfig/network to stop the scripts from modifying your custom firewall:

FIREWALL_MODS=no

Finally you save your firewall configuration to /etc/sysconfig/iptables and enable it with:

# /sbin/service iptables save
# /sbin/chkconfig iptables on

Now you should be good to go...

Thanks go to LQ member hazza for this info...

Good luck!

jmg1894 07-08-2004 01:26 PM

Everything seemed to go through but I am still unable to ssh or ftp. What else am I missing?

jeffreybluml 07-08-2004 02:23 PM

Whatkind of response are you getting when you try? Is this just an authentication problem, or indeed related to the firewall?

Please post the response you get when trying to ssh into your machine...

jmg1894 07-08-2004 02:30 PM

I get no response when I try to ftp or ssh. Just a timeout. I'm only assuming its a firewalll setting. I use lokkit but it never saves my settings and is always on the highest settting when I go back and check it.

jeffreybluml 07-08-2004 02:42 PM

Are you behind a router? Also, are you sure sshd is running? you might want to try

/sbin/service sshd start

to make sure it's running. If you are behind a router, you'll need to forward port 22 from your router to the box running ssh.

Otherwise, I'm just about out of ideas...aside from checking /var/log/messages for info regarding this...


All times are GMT -5. The time now is 08:00 PM.