ssh with localhost

Tim McGarry
Sun Nov 17 21:19:00 2002

I've not senn the alice, bob, charlie docu. but here's how you could do it.

from alice:    ssh -L 4444:charlie:22 bob

now from  alice again, leaving above session running

ssh -p 4444 5901:localhost:5901 localhost

then vncviewer localhost:1

You are using the first ssh session  to set up a tunnel that simply gives I
direct connection from the external internet machine, to the internal hidden

The second ssh session is used purely to get the connection to the localhost
port on the vncserver.

Tim McGarry

----- Original Message -----
From: "Scott Hyde" <>
To: <>
Sent: Saturday, November 16, 2002 11:49 PM
Subject: ssh with localhost

> I've been successful in initiating vncserver with the -localhost option by
> the command
> ssh -L 5901:localhost:5901 vncservermachine
> and then intiating a connection on vncviewer to localhost:1
> How do you initiate a connection similar to the Alice, Bob and Charlie
> computers that are on the VNC documentation.
> Suppose that Charlie is not available to the internet as a whole, but Bob
> is able to access Charlie through ssh.  Bob is connected to the internet
> so Alice can connect to Bob through ssh.  However, Alice can't connect to
> Charlie directly, but through Bob.
> Suppose Charlie has vncserver with the -localhost option running.  How can
> Alice connect to Charlie with vncviewer?
> I've tried the following two commands without luck
> ssh -L 5901:bob:8989 bob
> then in the ssh shell for bob type
> ssh -L 8989:localhost:5901 charlie
> But it doesn't seem to work.
> -Scott
> _______________________________________________
> VNC-List mailing list