mercurial - hg无法使用自定义 key 连接到bitbucket

标签 mercurial bitbucket ssh-keys

我的电脑上有

.ssh/config:

Host bitbucket
    HostName bitbucket.org
    User hg
    IdentityFile ~/.ssh/id_rsa_pwd  

.hg/hgrc
[paths]
default = ssh://hg@bitbucket.org/lohoris/varlibs

(运行OSX 10.6)

我在debian服务器上拥有完全相同的文件,但是在“尝试” shell登录时,两者都可以工作:
PTY allocation request failed on channel 0
conq: logged in as lohoris.

                           You can use git or hg to connect to Bitbucket. Shell access is disabled.
                                                                                                   Connection to bitbucket.org closed.

mercurial连接仅在我的计算机上有效,而在服务器上则拒绝合作:
lohoris@office:~/www/varlibs$ hg pull
remote: Permission denied (publickey).
abort: no suitable response from remote hg!

这与您在 key 错误时收到的消息相同,但当然不是错(正如我所说,尝试ssh bitbucket 确实可以)。

可能是使用了错误的 key ,因为它甚至没有试图问我密码短语,但是我无法理解为什么。

最佳答案

在您的路径中,应该使用ssh://bitbucket/lohoris/varlibs,而不是ssh://hg@bitbucket.org/lohoris/varlibs

关于mercurial - hg无法使用自定义 key 连接到bitbucket,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9497776/

相关文章:

version-control - 如何获得与给定版本最接近的版本,其中包含除 .hgtags 之外的其他更改?

mercurial - 如何在删除文件后将文件添加到 Mercurial 存储库

git - 在没有密码提示的情况下从 bitbucket 中获取 pull

ssh - 如何在 gitlab 中添加 SSH key ?

git - 我应该在我的 ssh 公钥中使用我的个人电子邮件吗?

version-control - Mercurial - 如何为 hgwebdir.cgi 填充存储库描述?

c# - 将所有 Team foundation 服务器项目移至 bit-bucket?

git - Github 与 Bitbucket 的命令相同/不同? git-sh 呢?

ruby-on-rails - 生成 SSH key (Win/msysgit) - Ruby on Rails 教程

mercurial - 如何获取自Mercurial的特定修订版以来受影响的文件列表