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.


Automating Private Key Authentication

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

Unprotected Private Key

Alternatively you can store the private key unprotected (without a passphrase). Note that this imposes a security risk, if someone gains access to the key.

When using unprotected key with scripting, 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