-   Linux - Newbie (
-   -   Help with ssh (possible firewall issue) (

HeadNoodle 02-15-2005 09:42 AM

Help with ssh (possible firewall issue)

I'm setting a text only Fedora 3 linux box up and want to enable ssh. I have loaded the sshd service and put in the added the following entries into iptables.

iptables -A INPUT -p TCP -i eth0 -s 0/0 --destination-port 22 -j ACCEPT
iptables -A INPUT -p UDP -i eth0 -s 0/0 --destination-port 22 -j ACCEPT

when doing a port scan remotely on the box port 22 isn't shown as open. Also when using PuTTY on a windows box i get Network error:No route to host. If i connect locally i can connect to ssh with no problem.

This is the first linux box i have attempted to setup so sorry if i am asking a stupid question.


nhs 02-15-2005 09:47 AM

The most likely problem is that rules are evaluated in order and you appended the rule to the end of the input chain. Any previous rule which DROPs or REJECTs the packet will be executed instead. Use -I INPUT 1 instead of -A INPUT and it should work (also I'm almost certain that SSH doesn't need UDP).

Crashed_Again 02-15-2005 09:48 AM

When you say locally do you mean you are ssh'ing into the machine from the machine? When you try to access the machine remotely are you using an IP address, hostname, domainname? Do you have a router or any other device that may be blocking the connection?

HeadNoodle 02-15-2005 11:05 AM

Thanks for that nhs, it worked a treat. Didn't think of something as simple as that. Thanks for your help :D

Yeah Crashed_Again I was ssh'ing into the machine from the machine. As said above nhs' solution worked for me. Thanks for replying to my problem so quickly. I'm sure you will se me on this site quite a bit :P

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