I need to add a private SSH key to Putty Agent (pagent.exe) every time a Windows server starts up -- before a user logs on interactively. The key is to be used by a service.
If it was a regular user that needed to use the key, I would just place a shortcut in the Startup folder, however, this does not work on a server, because no user logs in.
I need this on Windows Server 2008 as well as Windows Server 2003.
I figure this must be a pretty common use case as public key authentication with SSH and SFTP becomes more widespread.
You can provide a path to the key on the Target command line in the shortcut
Modify the
Target:
section to add the keyC:\Program Files\putty\pageant.exe C:\Program Files\putty\keys\iain.ppk
When your system starts pageant will load the key and if it requires a pass phrase to unlock it it will ask for it.
You can add multiple keys on the pageant command line too e.g.