hg没有使用自定义键连接到bitbucket

o0'*_*0'. 5 mercurial bitbucket ssh-keys

在我的电脑上我有

的.ssh /配置:

Host bitbucket
    HostName bitbucket.org
    User hg
    IdentityFile ~/.ssh/id_rsa_pwd  
Run Code Online (Sandbox Code Playgroud)

.hg/hgrc

[paths]
default = ssh://hg@bitbucket.org/lohoris/varlibs
Run Code Online (Sandbox Code Playgroud)

(运行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.
Run Code Online (Sandbox Code Playgroud)

mercurial连接仅适用于我的计算机,而从服务器拒绝合作:

lohoris@office:~/www/varlibs$ hg pull
remote: Permission denied (publickey).
abort: no suitable response from remote hg!
Run Code Online (Sandbox Code Playgroud)

这是当密钥错误时得到的相同消息,当然只有它没有错(正如我所说,尝试一个ssh bitbucket 确实有效).

有可能用错了钥匙,因为它甚至没有试图问我的密码,但我无法捉摸为什么.

Laz*_*ger 5

如果显示“权限被拒绝(公钥)”,则仅意味着找不到访问和推送到服务器所需的公钥。为了解决这个问题,您将运行以下命令:

ssh-agent
ssh-add <full path to your key file>
Run Code Online (Sandbox Code Playgroud)

ssh -T hg@bitbucket.org 也是很好的和快速的SSH调试器

  • 在`.hg / hgrg`中添加`[ui] ssh = ssh -C -i〜/ .ssh / id_rsa_pwd`可以达到目的。 (3认同)

Rin*_*ing 2

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