[英]hg clone ssh://user@url fails on windows 7 (cygwin), but works on OS X
I tried to do hg
to a remote server ( hg pull
or hg push
). 我试图对远程服务器进行
hg
( hg pull
或hg push
)。 Failed on Windows, but succeeded in OS X. I used the same ssh private and public keys for Windows and OS X. Here are the details: 在Windows上失败,但在OS X上成功。我对Windows和OS X使用相同的ssh私钥和公钥。以下是详细信息:
On Windows, I used cygwin, for which I also installed openssh. 在Windows上,我使用cygwin,为此我还安装了openssh。 The private and public keys are inside .ssh folder of cygwin home (
/home/simo/.ssh
). 私钥和公钥位于cygwin home (
/home/simo/.ssh
)的.ssh文件夹中。 When I did, say, hg clone ssh://simo@url
in cygwin, a popup windows of title TortoisePLink appears and asks me to enter Password, which, I believe, means the passphrase of the ssh key. 例如,当我在cygwin中执行
hg clone ssh://simo@url
时,会出现一个标题为TortoisePLink的弹出窗口,并要求我输入密码,我相信这意味着ssh密钥的密码短语。 I entered, and it immediately asks me to enter it again and again (the same popup window). 我输入了,它立即要求我一次又一次地输入它(同一弹出窗口)。 I double-checked the password, of course.
当然,我仔细检查了密码。 If I keep entering the password 5 times, then it stops and says
Too many authentication failures for simo
and abort: no suitable response from remote hg!
如果我连续输入5次密码,它将停止并提示
Too many authentication failures for simo
并abort: no suitable response from remote hg!
. 。
Ironically, if I don't use Cygwin, but use Command Prompt, I still run into the same issue. 具有讽刺意味的是,如果我不使用Cygwin,而是使用命令提示符,那么我仍然会遇到相同的问题。 This may be the key to understand the issue, because I am not sure the ssh used in command prompt is the same as the ssh used in cygwin, and therefore the ssh key does not seem to matter in either case.
这可能是理解该问题的关键,因为我不确定命令提示符中使用的ssh是否与cygwin中使用的ssh相同,因此,无论哪种情况,ssh密钥似乎都不重要。 First, I only stored the key for .ssh in cygwin, I ran into the problem.
首先,我只将.ssh的密钥存储在cygwin中,遇到了问题。 I tried command prompt (without copying the ssh keys to there), I also ran into the problem, so looks like the ssh key is not used at all during the
hg
. 我尝试了命令提示符(没有将ssh密钥复制到那里),我也遇到了问题,因此看起来在
hg
期间根本没有使用ssh密钥。 I then tried copying the key to the home dir of command prompt ( C:\\Users\\simo\\.ssh
), I also faced the same issue. 然后,我尝试将密钥复制到命令提示符的主目录(
C:\\Users\\simo\\.ssh
),我也遇到了同样的问题。
I copied the ssh keys to my Mac OS X, put them inside .ssh, and run. 我将ssh密钥复制到了Mac OS X,将它们放入.ssh中,然后运行。 Everything works fine.
一切正常。 Any idea why I failed on Windows with hg ssh?
知道为什么我在Windows上使用hg ssh失败了吗? Could the problem is because if Cygwin?
可能是因为Cygwin吗? Because the ssh keys are not used/not found?
因为ssh键未使用/未找到? and why the heck the popup window with title TortoisePLInk keeps asking me for password?
为何为什么标题为TortoisePLInk的弹出窗口总是要求我输入密码?
On Windows you can have two different formats for ssh keys: 在Windows上,您可以使用两种不同的ssh密钥格式:
So you have to choose which one you want to use. 因此,您必须选择要使用的那个。 Note that you can "import" you Unix format keys into a Pageant agent, this should then work right out of the box with Tortoise.
请注意,您可以将Unix格式的密钥“导入”到Pageant代理中,然后与Tortoise一起即可使用。
But you can also configure in mercurial.ini
to use the Cygwin ssh (see for instance this answer: https://stackoverflow.com/a/18973676/236726 ) 但您也可以在
mercurial.ini
配置为使用Cygwin ssh(例如,请参见以下答案: https : //stackoverflow.com/a/18973676/236726 )
Hope it'll help. 希望能对您有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.