Can I port forward to an established reverse ssh tunnel

Posted by Ben Holness on Server Fault See other posts from Server Fault or by Ben Holness
Published on 2010-04-26T23:49:06Z Indexed on 2010/04/26 23:53 UTC
Read the original article Hit count: 331

Filed under:
|
|

I have three computers, A, B and C

A has initiated a reverse ssh tunnel to B:

ssh -nTNx -p 443 -R 22222:localhost:22 [user]@[server]

If I log in to B, I can use 'ssh -p 22222 localhost' and I get a login prompt for A. If I try 'ssh -p 22222 [public IP of B]', it doesn't work

What I would like to be able to do is have C connect to A without needing to login to B. So from C I could 'ssh -p 22222 [public IP of B]' and I would get the login prompt for A.

I am using debian and shorewall and I have a basic understanding of how things work. I have tried various combinations of REDIRECT and DNAT rules, but haven't had any luck. I have tried using the same port (22222) and a different port (forwarding 22223 from C to 22222 on localhost).

Any ideas?

Cheers,

Ben

© Server Fault or respective owner

Related posts about reverse

Related posts about ssh