Re: Trouble using VNC thru a ssh tunnel

From: Anders Larsen (a.larsen@identecsolutions.de)
Date: 04/26/02


From: Anders Larsen <a.larsen@identecsolutions.de>
Date: Fri, 26 Apr 2002 11:34:28 +0200

Gary wrote:

> I am able to run VNC without port forwarding by starting a vncserver
> on work and issuing the command 'vncviewer work:1' from home.
>
> But when I do this with port forwarding (work:5901 --> home:5902) by
> first establishing a ssh connection with 'ssh -L 5902:work:5901 work'
> and then issuing the command 'vncviewer localhost:2' from another
> pseudotty, I get the following error.
>
> vncviewer: VNC server closed connection

The hostname in the -L option is as seen by the *remote* side;
use 'ssh -L 5902:localhost:5901 work' instead.
This will cause 'work' to connect to 'localhost:5901', that is,
to itself (which is what you want, I guess).

(BTW, if the vncserver isn't listening to 5901 you get the same
error message).

> debug1: Connections to local port 5902 forwarded to remote address
> work:5901
> socket: Address family not supported by protocol
> I have tried forcing
> ssh protocol 1 and ssh protocol 2, but this had no effect.

I get the same debug output here - it seems it can be safely ignored.
As long as ssh doesn't complain without the -v option, all is well.

> I use iptables on both home and work, so I disabled the iptables rules
> on both machines for a short period of time, but this had no effect.

HTH
Cheers
  Anders



Relevant Pages

  • RE: VNC help
    ... I tried man vncviewer and no such entry exist. ... google for more information. ... >>the other way, is to run vncserver from the command line, giving you ... >>access to the desktop from which you ran the command. ...
    (RedHat)
  • Re: [SLE] Question: VNC
    ... > Start vncserver on home box, then, from remote host: ... > then, in another xterm, run vncviewer: ... You can do both of these with the following command: ...
    (SuSE)
  • Re: plink and vncviewer
    ... >> between start and vncviewer to give plink time to establish the link. ... It needs a little extra-trick, so the command (in ...
    (comp.security.ssh)