[svlug] ssh reverse forward question

Uriah Welcome precision at devrandom.net
Thu Jul 25 16:34:41 PDT 2002

On Thu, 2002-07-25 at 16:26, matt at vazor.com wrote:
> Hi,
> I'm using something like:
> ssh -R 5901:localhost:5901 host -N
> To reverse forward port 5901 on a solaris box to port 5901 on my Linux firewall
> machine.  Now, I can connect to 5901 using vnc on the Linux machine fine, but
> I'd rather connect to this forwarded port from another machine, to an interface on the Linux box (
> ssh -R 5901: host -N
> But, this doesn't seem to work...  I stumbled across the GatewayPorts option, but that works on the machine from which I initiate ssh...
> Anyone know how I can reverse forward a port from host A to host B, but connect to the port on host B from yet another machine host C.  Host B just becomes effectively a passthrough.

I ran into this exact same thing the other day.  What I ended up doing
was the 'ssh -R 5901:localhost:5901 host -N' and then on the firewall
itself doing a 'ssh -g -L 5901:localhost:5901 localhost'.  The -g is the
important option there..

- U

"Any setuid root program that does an exec() somewhere is just a less 
user friendly version of su."   -- Olaf Kirch on bugtraq 2000-08-07
 1024D/6388D686   7928 83A9 16CD 52FD F77F  11ED FC04 B683 6388 D686

More information about the svlug mailing list