我使用Puttygen创建公钥和私钥,然后准备让Windows 7上的TortoiseHg通过转到
来克隆ssh://somebody@code.somewhere.com/somecode
但似乎没有将私钥添加到TortoiseHg的位置? (甚至只是mercurial命令行)
该文件已经在硬盘上的某些位置,因为somefile.ppk有人知道如何添加它吗?
答案 0 :(得分:77)
将以下内容添加到主目录中mercurial.ini的[ui] -section(假设您的密钥位于“C:\ Users \ UserName \ mykey.ppk”中):
[ui]
ssh = tortoiseplink.exe -ssh -i "C:\Users\UserName\mykey.ppk"
或使用在TortoiseHg安装路径中找到的Pageant(例如C:\ Program Files \ TortoiseHg \ Pageant.exe)。启动它,双击出现的任务栏图标,然后添加.ppk文件。
答案 1 :(得分:0)
need an ssh key generator first
1: cmd: ssh-keygen -t rsa
2: open PuTTY Key Generator
3:Conversions > import key: open the id_rsa file in C:\Users\<username>\.ssh (you may have to create the folder !must run cmd as Admin!)
4:Save the imported file id_rsa as id_rsa.ppk
5:Open Pageant.exe in TortoiseHG folder
6:It will show up in Taskbar
7:Right click and click add keys
8:Finally add your new ppk file
Oh right copy the contents of id_rsa.pub to hg host