Objective: connect to my netbooks X session using VNC, tunnelled over SSH.
Since my netbook runs a GNOME centric distribution, I'm using the "Remote Desktop" preferences program on "System -> Preferences". If you're like me and to damn lazy to hunt and peck, this just runs the program 'vino-preferences'. On here it's possible to setup VNC access to your desktop. In essence, it just runs vino when you login. There are loads of good and bad write ups on VNC server setup and 3 or 4 click setup is good enough for me.
My iptables rules pretty much block such things as incoming VNC requests, which is good because I don't want the session exposed across the network interface. Pretty much all there is for accessing my netbook is the SSH port.
Now on another system, it's possible to connect using SSH forwarding. This gains us both encryption for the VNC session and less port exposure; that is good for security.
PuTTY client setup:
- Load/create your session in PuTTY
- Go to SSH -> Tunnels
- Add a port forwards
- source port: 5900
- destination: localhost:5900
- Login to the system using PuTTY.
OpenSSH client setup:
- ssh -L 5900:localhost:5900 username@host
There are options for both if disabling the shell session and only running the forwarding is preferred (PuTTY: SSH->Don't start a command at all; OpenSSH -> RTFM for -n, -N, and -f). 5900 is the default VNC port running off the server end (my netbook).
Now on the client machine, connecting any VNC client (e.g. TightVNC) to localhost should give the desktop session over at user@host; in this case, my X session on alice!
This is the shortest, sweetest, non-non-sense, you're assumed to know how to RTFM if you want to know the facts, kind of write up that I've seen on doing this. Hmm, maybe it helps that I already know how to use SSH port forwarding with OpenSSH, hehehe.