vnc with ssh, viewer behind a router

Michael Herron m-herron "at"
Thu, 31 Jan 2002 04:45:23 +0000


I have a linux box at work and I want to be able to access this
machine from home.  At home I have a cable modem in front of a router
that does NAT.  One of the machines plugged into the router is a box
running w2k.

I start vncserver on the linux box.  I can then connect to this
machine without problems from the w2k box.  vncserver runs on port 1
of the linux box so I connect with vncviewer to snoopy:1 (going with
the snoopy theme)

But, I want to tunnel through ssh.  So, I do

ssh -L 5902:snoopy:5901 snoopy 

from my w2k box.  This works fine after I give a password.  If I
understand this correctly, this tells the w2k box to link its port
5902 to 5901 on snoopy.  This is because 5901 on snoopy is where the
vncserver is running.  

But, I cannot seem to connect to this server.  My ip address behind
the router is so I try to get vncviewer to connect to  I always get the message "Failed to Connect to

Can anyone explain how to fix this?  Do I have to enable some sort of
port forwarding behind the router?  Right now no ports are forwarded.


To unsubscribe, mail majordomo "at" with the line:
'unsubscribe vnc-list' in the message BODY
See also: