我的电脑上有
.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/