星期三, 11月 03, 2010

How to create a ssh tunnel with PuTTY




Download PuTTY
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.60-installer.exe


Install PuTTY


Execute PuTTYgen
-> Generate -> Save private key -> c:\mykey.ppk


Copy the content in "Public key for pasting into OpenSSH authorized_keys file:"


Close PuTTYgen


Login to OpenSSH server with username/password


Open ~/.ssh/authorized_keys


Paste the content into the file


Logout 


Execute PuTTY


New a session, ex: mytunnel
Connection - Data - Login details - Auto-login username:
fill you username
Connection - SSH - Auth - Attempt authentication using Pageant
Connection - SSH - Auth - Allow agent forwarding
Connection - SSH - Auth - Private key file for authentication:
c:\mykey.ppk


Connection - SSH - Tunnels - Source port: 8080
Connection - SSH - Tunnels - Dynamic
Connection - SSH - Tunnels - Auto
Press Add


Session - Save


Close PuTTY


Copy short cut of "All Programs - PuTTY - Pageant" into "Program set\Startup"


right click on the short cut, select content


Modify the Target to
"C:\Program Files\PuTTY\pageant.exe" c:\mykey.ppk

沒有留言: