[Cialug] SSH Forwarding

cialug@cialug.org cialug@cialug.org
Thu, 06 Jan 2005 14:32:02 +0000


I'm trying to forward ports to a remote machine at my work.  The problem is that
I have to go to a gateway machine first.  I'm trying one of 2 different
forwards, one VNC, and one X.  It doesn't matter which one I get working.

I'm trying to forward a local port to a remote machine running VNC.  My command was:
ssh -g -L5985:172.18.128.54:5900 -P -t -C username@gateway

I used 5985 since I don't have a local VNC running on that port.  The remote
machine is a Win2k box run tightvnc.  I then run vncviewer localhost:85.  It
connects to the remote machine, I enter the password, but then the session dies.
 If I turn on very very verbose, I get the following:
debug1: channel_free: channel 2: direct-tcpip: listening port 5985 for
172.18.128.54 port 5900, connect from 127.0.0.1 port 42142, nchannels 3
debug3: channel_free: status: The following connections are open:
  #1 client-session (t4 r0 i0/0 o0/0 fd 5/6)
  #2 direct-tcpip: listening port 5985 for 172.18.128.54 port 5900, connect from
127.0.0.1 port 42142 (t4 r2 i3/0 o3/0 fd 8/8)
debug3: channel_close_fds: channel 2: r 8 w 8 e -1
Any ideas?

The second one I'm trying is forwarding X apps.  The command I used was:
ssh -g -X -P -t -C username@gateway

When I ssh to the gateway, I can start an xterm from there.  However, my
destination machine does not run sshd, so I can't ssh into there.  I can telnet
in, but telnet doesn't forward the DISPLAY variable.  On the gateway, my DISPLAY
is set to localhost:10.0.  After telnetting to my destination, I've tried
setting the DISPLAY to gateway:10.0 and starting xterm with no luck (can't open
display).  I've made sure to run xhost + on both my local machine and the
gateway.  Someone told me that sshd on the gateway wasn't set up properly, but
he couldn't tell me what was needed.  Can anyone give me some ideas?  Maybe I
can pass them along to the admin of the gateway and have him set it up correctly.

--
Tim W.