This page describes how to set up PuTTY ssh for tunneling VNC and Windows share connections. This allows you to export your Linux box's desktop to any Windows computer.
1. Set the Linux server machine's firewall to accept VNC connections (port 5901) ONLY from localhost, NOT from any other machine. While you're at it, block ALL access to port 5801 (VNC http access).
2. On the windows machine, start up PuTTY ssh. Go to SSH/Tunnels. In 'Source port' type 5901. In 'destination' type 'localhost:5901'. You should see the display "L5901 localhost:5901" which means that local port 5901 ("L"5901) gets forwarded to localhost on the ssh server, port 5901.
3. Start the VNC server on the Linux box. For example, I do "tightvncserver :1 -geometry 1280x1024", which starts the server on screen 1 at a resolution of 1280 x 1024.
4. On the Windows machine, FIRST connect to the Linux box via ssh. THEN start up the vnc viewer, and indicate that the machine is "localhost". It should connect and ask you for your VNC password.
When starting X windows applications, remember that your screen is :1, not :0 (the usual default).
This relies on Samba being run on the ssh server, so set up Samba on the Linux box first.
Then, follow the same procedure as above for VNC, but
forwarding the following ports:
137, 138, 139, 445.
Make sure the Linux box firewall allows Samba ports (listed above) to be accessed from localhost.
Once that is all done, the list of "Forwarded ports:" on the
PuTTY ssh machine should look like this:
L5901 localhost:5901
L137 localhost:137
L138 localhost:138
L139 localhost:139
L445 localhost:445