This is an old revision of the document!

How can I connect without entering private key passphrase each time?

Using Authentication Agent

The best solution is to use authentication agent (Pageant), so that you enter the passphrase only once.

Advertisement

Automating Private Key Authentication

You can specify the passphrase using -passphrase switch of open command in scripting and using SessionOptions.SshPrivateKeyPassphrase in .NET assembly.

Alternatively you can store the key unprotected (without an passphrase). Note that this imposes security risk, if someone gains access to the key. You should consider restricting access to the unprotected private key file to the local account that runs the script only (using Windows file system permissions).

Last modified: by martin