简体   繁体   English

hg clone ssh:// user @ url在Windows 7(cygwin)上失败,但在OS X上有效

[英]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 ). 我试图对远程服务器进行hghg pullhg 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 simoabort: 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密钥格式:

  • if you use Cygwin and openssh the format is similar to Unix one 如果您使用Cygwin和openssh,则格式与Unix类似
  • if you use PuTTY/Pageant (ssh agent) the format is different 如果您使用PuTTY / Pageant(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.

相关问题 Windows上通过ssh的Mercurial“ hg clone”(带有plink问题) - Mercurial “hg clone” on Windows via ssh with plink issue Visual Studio-Git克隆无法通过SSH进行故障转移,但可以通过HTTPS进行工作 - Visual Studio - Git clone fails over SSH, but works over HTTPS 是否可以通过ssh进入Windows(通过cygwin sshd)并在登录的Windows用户桌面上启动程序? - Is it possible to ssh into Windows (through a cygwin sshd) and start a program on a logged in Windows user's desktop? Ohai无法确定cygwin中的os_version - Ohai fails to determine os_version in cygwin “(.hg not found)”从cygwin托管的存储库通过ssh克隆到Mac和FreeBSD客户端时 - “(.hg not found)” when cloning from cygwin-hosted repository via ssh to Mac and FreeBSD clients 在 Windows 上使用 Cygwin 的 SSH ControlMaster 实际上可能吗? - Is SSH ControlMaster with Cygwin on Windows actually possible? Pexect 在 Windows 批处理文件 > Cygwin > Python > SSH - Pexect in Windows Batch File > Cygwin > Python > SSH 如何获得适用于Windows和OS X的Qt 5.4.0源代码 - how to get Qt 5.4.0 source that works for BOTH Windows and OS X .NET 标准 2.0 - Windows 注册表 - 适用于 Mac OS X - Unity - .NET Standard 2.0 - Windows Registry - works on Mac OS X - Unity 如何使用hg-git在Windows中克隆github存储库 - How to clone a github repo in Windows using hg-git
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM