# How can I automatically start an SSH tunnel when I put in my Pageant password?

I need an SSH tunnel for my VNC to work. Currently I have a PuTTY connection that creates the tunnel, but which requires Pageant to authenticate. I also have Pageant, VNCc, and PuTTY in my Windows startup.

The annoyance for me is that PuTTY can't create the tunnel until after I put in my Pageant password. That means I can't just have PuTTY automatically connect to the session and sit in the background, I need to manually open a connection each time after I connect to Pageant.

Is there a way to better automate this, so the SSH tunnel 'just happens' at bootup without my having to do anything manually (other then my putting in my Pageant password, which I'm okay with doing for security)?

Pageant can execute a command after a private key is loaded, using -c switch.
pageant.exe c:\path\to\mykey.ppk -c putty.exe -L 1234:localhost:1234 user@host