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

11,764

Solution 1

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

Solution 2

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:
11,764

Related videos on Youtube

zegkljan
Author by

zegkljan

I started with Apple Basic and 6502 machine code and Assembly, then went onto Fortran, Pascal, C, Lisp (Scheme), microcode, Perl, Java, JavaScript, Python, Ruby, PHP, and Objective-C. Originally, I was going to go with an Atari... but it was a big expense for my family... and after months of me nagging, my dad agreed to buy an Apple ][. At that time, the Pineapple was also available. The few months in childhood seem to last forever. A few months nowadays seem to pass like days. Those days, a computer had 16kb or 48kb of RAM. Today, the computer has 16GB. So it is in fact a million times. If you know what D5 AA 96 means, we belong to the same era.

Updated on September 18, 2022

Comments

  • zegkljan
    zegkljan almost 2 years

    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://[email protected]/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?

  • Zero3
    Zero3 almost 8 years
    Does not work for me: remote: 'tortoiseplink.exe' is not recognized as an internal or external command, remote: operable program or batch file.
  • David Cary
    David Cary about 7 years
    "if I give plink.exe the -ssh parameter, the saved PuTTY session is not used and therefore it doesn't use the correct port number. The -ssh parameter is unnecessary anyway, because SSH is the default protocol." -- mercurial-scm.org/wiki/AccessingSshRepositoriesFromWindows
  • David Cary
    David Cary about 7 years
    @Zero3: After I installed TortoiseHg and PuTTY, I added this line to my "C:\Users\dc\mercurial.ini" file in the [ui] section: ssh = "C:\Program Files\TortoiseHg\lib\TortoisePlink.exe" -i "C:\Users\dc\.ssh\github_rsa.ppk"