Saturday, April 05, 2014

Tunnelling VNC (or anything) over ssh

To set up a tunnel to reach a vnc server running on port 5901 of remote_host, it is possible to tunnel the port over an ssh connection. Then you just connect to localhost:5901 

ssh -C -L 5901:localhost:5901 -N -f -l remote_user -p 22 remote_host

So that is:
ssh -C -L local_port:localhost:remote_host_port -N -f -l remote_user -p 22 remote_host