SSH and Routers

The geek forum. PHP, Perl, HTML, hardware questions etc.. it's all in here. Got a techie question? We'll sort you out. Ask your questions or post a link to your own site here!

SSH and Routers

Postby blkmage » Sun Oct 24, 2004 4:00 pm

I've learned about the wonders of ssh. I've succesfully done it on my boxes inside my LAN. But, I can't seem to get to it using my IP address. I've done port forwarding to the box and everything, but no matter which computer I use, it refuses the connection. I've set it to port 22222 and it still doesn't work.
User avatar
blkmage
 
Posts: 4529
Joined: Mon May 03, 2004 5:40 pm

Postby Mithrandir » Sun Oct 24, 2004 8:52 pm

To confirm:

1. You are trying to ssh to a machine behind your firewall, from a machine outside the firewall.

2. You have the SSH server running, and can connect to it (on 22,222) from inside the firewall (and it's not getting a DHCP ip address).

3. You have your router set to forward traffic on port 22,222 to your local IP address.

4. You are trying to ssh to the appropriate port from a box outside the firewall.


Correct?
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby shooraijin » Sun Oct 24, 2004 8:54 pm

Try telnetting to the port from outside instead of ssh.

Connection refused = sshd2 isn't even running (or port forwarding isn't working)
Connected/Connection closed (right after) = sshd2 doesn't like the outside host
Connected (stays connected) = home free, check something about your client

I had a lot of trouble with my sshd2 initially. Turns out there's an option to disallow hosts that can't be reverse-looked-up. Make sure that's not enabled in your configuration file (many installations have this on by default).
"you're a doctor.... and 27 years.... so...doctor + 27 years = HATORI SOHMA" - RoyalWing, when I was 27
"Al hail the forum editting Shooby! His vibes are law!" - Osaka-chan

I could still be champ, but I'd feel bad taking it away from one of the younger guys. - George Foreman
User avatar
shooraijin
 
Posts: 9927
Joined: Thu Jun 26, 2003 12:00 pm
Location: Southern California

Postby blkmage » Mon Oct 25, 2004 12:36 pm

oldphilosopher wrote:4. You are trying to ssh to the appropriate port from a box outside the firewall.
I was trying to ssh from one of my boxes inside using the external IP. I don't think that's supposed to work now that I think about it.

sshd is running, port forwarding doesn't seem to be working.

What would I look for in my sshd_config if I wanted to turn that host reverse lookup off?

But, I have a new problem. I don't think my school's router is letting me get through. Would I have to ask the admin and hope he'll open it up, or can I tunnel through another port?
User avatar
blkmage
 
Posts: 4529
Joined: Mon May 03, 2004 5:40 pm

Postby Mithrandir » Mon Oct 25, 2004 2:34 pm

I don't think my school's router is letting me get through. Would I have to ask the admin and hope he'll open it up, or can I tunnel through another port?


If you set it to a "standard" port, you'll probably be OK. I've setup one of my IP addresses to accept ssh on port 80, since I've got the website running on a different IP address. ;)

I'll let shooby answer the other questions...
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby blkmage » Mon Oct 25, 2004 4:05 pm

I can't ssh to myself using my IP. I can do it through localhost and 192.168.0.2, but my IP gets me a connection refused.
User avatar
blkmage
 
Posts: 4529
Joined: Mon May 03, 2004 5:40 pm

Postby Mithrandir » Mon Oct 25, 2004 4:21 pm

That's from outside the firewall, yeah?
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby blkmage » Mon Oct 25, 2004 4:47 pm

No. I'm trying to get it to connect to itself, so it'd be kind of going out and back in.
User avatar
blkmage
 
Posts: 4529
Joined: Mon May 03, 2004 5:40 pm

Postby Mithrandir » Mon Oct 25, 2004 6:08 pm

I'd guess your router is programmed not to allow that... Do you have any way to test it from a box outside the line?

One other thing: Can you get to it from another machine on your internal network, using it's IP address? If so, it would almost certainly indicate that you have a router configuration issue.

Then we can figure out what kind of router it is, and help you figure out how to configure it.
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby blkmage » Mon Oct 25, 2004 6:13 pm

No machines work with the external IP. In theory, everything should work perfectly. I have a Netgear RP614.
User avatar
blkmage
 
Posts: 4529
Joined: Mon May 03, 2004 5:40 pm

Postby Mithrandir » Mon Oct 25, 2004 6:28 pm

Heh. In theory all surfacises are without friction and conversations always go the way I want.

But I digress... Netgear huh? Hmm... I'll TRY to help you with it. Can you post a screen capture of the appropriate screen on the config website?
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby blkmage » Mon Oct 25, 2004 6:54 pm

Port 80 is forwarded to my compy, 192.168.0.2. SSH is running on port 80.
You do not have the required permissions to view the files attached to this post.
User avatar
blkmage
 
Posts: 4529
Joined: Mon May 03, 2004 5:40 pm

Postby Mithrandir » Mon Oct 25, 2004 8:15 pm

Everything looks right. I think you'd better look at shooby's reverse resolve issue. Hey shooby, what's my line?
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby blkmage » Tue Oct 26, 2004 3:57 am

I think I found it, but it still doesn't work. I think it's UseDNS and I set it to no.

Because it's on port 80, I saw something when I accidentally went there to 192.168.0.2. But, if I tried my IP, it'd say connection refused. My ISP only blocks port 25.
User avatar
blkmage
 
Posts: 4529
Joined: Mon May 03, 2004 5:40 pm

Postby shooraijin » Tue Oct 26, 2004 11:29 am

In my particular sshd2, the line is RequireReverseMapping no. I think it should be in OpenSSL/OpenSSH too, if that's what you're using.
"you're a doctor.... and 27 years.... so...doctor + 27 years = HATORI SOHMA" - RoyalWing, when I was 27
"Al hail the forum editting Shooby! His vibes are law!" - Osaka-chan

I could still be champ, but I'd feel bad taking it away from one of the younger guys. - George Foreman
User avatar
shooraijin
 
Posts: 9927
Joined: Thu Jun 26, 2003 12:00 pm
Location: Southern California


Return to Computing and Links

Who is online

Users browsing this forum: No registered users and 168 guests