Ssh – How to let TortoiseHg (Mercurial) on Windows use the Private Key file generated (by Puttygen)

mercurialpublic-keyputtysshtortoisehg

I have used Puttygen to create a public and a private key, and I'm now ready to let TortoiseHg on Windows 7 do a clone by going to

ssh://somebody@code.somewhere.com/somecode

but there seems to be no where to add the private key to TortoiseHg? (or even just the Mercurial command line)

The file is already some where on hard disk as somefile.ppk. Does someone know how to add it?

Best Answer

From the answer almost the same question at stackoverflow.com (by David Tischler):

Add the following to the [ui]-section of the mercurial.ini in your home directory:

[ui]
ssh = tortoiseplink.exe -ssh -i "C:\Users\UserName\mykey.ppk"

Or if you want to specify your ssh username, add

[ui]
ssh = tortoiseplink.exe -ssh -i "C:\Users\UserName\mykey.ppk" -l myusername

(assuming your key is in "C:\Users\UserName\mykey.ppk").

Pageant (already mentioned by others) should work also (even though I haven't tried it myself).