l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
August 5: Social gathering
Next Installfest:
TBD
Latest News:
Jul. 4: July, August and September: Security, Photography and Programming for Kids
Page last updated:
2006 Dec 10 06:05

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Tunneling vnc over ssh
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Tunneling vnc over ssh



Henry House wrote:
I normally do this to connect to my VNC session from a remote host with
tunneling through ssh:

ssh wotan.hajhouse.org cat .vnc/passwd > .vnc/passwd
ssh -CNf wotan.hajhouse.org -L 5902:wotan.hajhouse.org:5902
xtightvncviewer :2 -passwd .vnc/passwd \
-encodings 'copyrect tight hextile zlib corre rre raw'

Surely there must be a more automatic way to set up the ssh tunnel and
authenticate to the VNC server. I have looked at gnome-rdp and KDE's
remote-desktop client, but neither has apparently any concept of vnc
tunneled over ssh. In xtightvncviewer there is an option -via that
appears to do what I want (setting up an ssh tunnel automatically), but
my best effort at using it,
sudo xtightvncviewer wotan.hajhouse.org:2 -via \
hajhouse@wotan.hajhouse.org -passwd .vnc/passwd

did not work (the process hung, no vnc window appeared). The sudo in
the above was necessary to allow xtightvncviewer to bind to a
privileged port, the need for which I fail to grasp.

Has anybody used xtightvncviewer this way sucessfully?


Sounds like you should just write a script on your local machine to do these in order.

Typically I have port forward preconfigured by hostname in my .ssh file.
so I can just type:
ssh work
and it's asks me for my password and forwards 5900 to 5900 locally.
Example from http://linuxgazette.net/115/chirico.html:
## Linux Laptop .ssh/config ##
Host work
HostName 66.35.250.203
User sporkey
LocalForward 20000 192.168.0.66:80
LocalForward 22000 192.168.0.66:22
LocalForward 22139 192.168.0.8:139
LocalForward 22110 192.168.0.5:110
(Your case) LocalForward 5902 5902
This solves the how to automate ssh.

As for the vncviewer, I have an icon setup on my toolbar that I click and it has all the parameters in it.(you could do this with a short script too)
just make a file(executable) and put
>xtightvncviewer :2 -passwd .vnc/passwd \
> -encodings 'copyrect tight hextile zlib corre rre raw'

I'm not familiar with the password stuff you're doing but to be honest my vncserver isn't running by default. I actually turn it on once I'm in via ssh and then connect to the vnc.
Call it a little extra paranoia.

Alex




_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.