You can use a key agent to hold your key. It looks like you are using Windows based on that path. Depending on the SSH client you are using, OpenSSH under Cygwin, OpenSSH in MSYS, or PuTTY, the steps will be different.
Under OpenSSH, the easiest way to set up and use a key agent is using Keychain. Install it from the Cygwin package manager, then read the documentation in man keychain
. The basics are to add eval $(keychain --eval id_rsa)
to your .profile
. Once you set it up, it will prompt you for your password once when you first open a terminal, then keep it in memory in an agent.
I don't believe that MSYS has a package for Keychain, but you can also use ssh-agent manually, it's just a little more cumbersome as it doesn't save the same agent information between different shells. Just edit your ~/.bashrc
to include:
eval $(ssh-agent)
ssh-add
Then it will prompt you once per terminal session, which is better than once per operation.
If using PuTTY, then use Pageant to set up an SSH agent. You can set it up to prompt you for your password once on login, then keep your key in memory. Check the documentation for details.