Sunday, October 26, 2008

vnc in ssh tunnel

I recommend using something else than port 22 for ssh. Edit /etc/ssh/sshd_config to change the port.

Create the vnc via variable for vnc:
Just:
export VNC_VIA_CMD='/usr/bin/ssh -2 -x -p 30022 -l user -f -L %L:%H:%R %G sleep 20'

Note the use of -p 30022, here's where I've changed the port to listen on for the ssh server. Also change "user" to a user name on the server.

No I can start the vnc client:
vncviewer -via mydomain.com 192.168.0.2:1

using mydomain.com as a gateway.

0 comments: