@ECHO OFF @REM vnc-hal.bat 2009-07-10 Bruce Bartram @REM Given: @REM C:\Program Files\PuTTY\putty.exe @REM with Saved Session halvnctunnel @REM C:\Program Files\RealVNC\VNC4\vncviewer.exe @REM desktop shortcut to this file with VNC icon @REM @REM C:\Program Files\Windows Resource Kits\Tools\sleep.exe @REM somewhere in the path may in this directory ? @REM from Windows Server 2003 Resource Kit Tools @REM http://www.microsoft.com/downloads/\ @REM details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en PATH %PATH%;"C:\Program Files (x86)\PuTTY";"C:\Program Files (x86)\RealVNC\VNC4";"C:\Program Files\Windows Resource Kits\Tools" PATH @REM use putty to create a tunnel between this PC's locahost @REM port 56789 and hal at BAO localhost:5900, the vnc port START putty -load "halvnctunnel" sleep 5 @REM and crank RealVNC viewer aimed at localhost:56789 vncviewer 127.0.0.1::56789 @REM end @REM Bruce's notes on building the pieces @REM @REM PuTTY start by making a simple login session named hal @REM load a default session and change: @REM Session: Host name 10.173.85.1 (hal's ip address) @REM Saved Session hal @REM Connection: Data your user name on hal @REM SSH SSH2 only @REM back to Session and hit SAVE so session hal is saved (in Registry) @REM test the session PuTTY double click on hal and see if it asks passwd @REM @REM Next generate a public/private ssh key pair (or import one also with puttygen) @REM @REM C:\Program Files\PuTTY\puttygen.exe @REM change Number of bits to 2048, check that SSH2-RSA is selected @REM click "Generate" and wiggle the mouse on/off the blank line to @REM give some randomness. @REM save the private and public keys. I put mine in my cygwin .ssh dir @REM but your Documents... Application... PuTTY would work @REM and change the permissions to make it read only for you. @REM @REM in a separate window, open your PuTTY hal session, login @REM mkdir .ssh ; chmod 700 .ssh ; cd .ssh @REM echo >authorized_keys ' ... ' with the ... cut-and-pasted from the puttygen window. @REM @REM PuTTY, single click session hal, go to Connection: SSH: auth and @REM browse Private key file for authentication @REM GO back to Session and SAVE, then test using OPEN @REM it should connect and auto login to the bash promt on hal. @REM @REM Now create a PuTTY session with a tunnel from the auto-login hal session @REM PuTTY Session hal click once @REM Saved Session change to halvnctunnel @REM Connection: SSH: tunnels @REM Source port 56789 @REM Destination 127.0.0.1:5900 (the hal VNC server listens on this) @REM Window: make it much smaller, say 40 columns and 9 rows @REM Session: SAVE @REM @REM now things are ready for this script @REM end