Load multiple password-protected OpenSSH keys

I have 2 SSH keys I need to load when starting SourceTree, which are password-protected.

Since I am on Windows and can't use Pageant (due to its lack of support to OpenSSH keys) I have to use OpenSSH, but it doesn't properly work:

  • if there is just one key added into SourceTree, a command line pops up asking me for the password (and it works)
  • if I add a second key through SourceTree (Tools -> Add SSH key), it asks me for the password (and it works)
  • if I close SourceTree and open it up again, a command line pops up and then immediately closes itself, thus failing to load both of my SSH keys

Is there a way to solve this? The only workaround is to re-add the SSH key I need just before fetching/pushing, if I remember I previously closed SourceTree or rebooted my PC.

1 answer

You can use the putty key generator to convert OpenSSH private keys to the format pageant prefers. They should still work fine with the openssh public keys.

I really don't want to keep multiple copies of my keys, isn't there another solution?

Do you use the private keys for something that requires the openssh format? The conversion can work both ways, so you could merely keep the ppk format for your private keys, and convert your public keys to openssh or putty's public keys as necessary. I generate all my keys with puttygen, and invariably have to convert my public keys to openssh for installation on linux servers.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

559 views 1 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you