Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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?

share|improve this question

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

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

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

Or if you want to specify your ssh username, add

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).

share|improve this answer
Does not work for me: remote: 'tortoiseplink.exe' is not recognized as an internal or external command, remote: operable program or batch file. – Zero3 Jul 8 at 22:58

Since this un(fully)answered question is towards the top of the Google results; you can find a detailed guide by row1 @

share|improve this answer
Nice guide ;) ... – row1 May 9 '11 at 9:45

Looks like you need to run pageant.exe on the .ppk file generated by putty to register it in a place that hg can find it.

share|improve this answer

You don't add the key to TortoiseHg or to Mercurial. Instead, these programs will call Putty (via plink.ext, I think) and that program will need to know about the key.

It's been a while since I used Windows, but as I remember, Putty lets you save your settings under a profile name. That includes the username, hostname, and private key to use. If you create a profile called foo, then cloning from ssh://foo/ should work.

share|improve this answer

you should edit hgrc.d/Mercurial.rc

simple search for line with

ssh = "TortoisePlink.exe" -ssh -2

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.