[英]Bitbucket Permission denied (publickey). but works with ssh
Hello, if i try to connect with bitbucket.org using ssh你好,如果我尝试使用 ssh 连接到 bitbucket.org
ssh -vT git@bitbucket.org
Everything works fine一切正常
debug1: Authentication succeeded (publickey).
But if i try to use the git clone
command i recive this message:但是,如果我尝试使用
git clone
命令,我会收到此消息:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Some extra information:一些额外的信息:
~/.ssh/
~/.ssh/
ssh-add -l
returns the correct key.ssh-add -l
返回正确的密钥。 (RSA) I was able to make this work, but there was multiple problems with my git implementation:我能够完成这项工作,但是我的 git 实现存在多个问题:
git clone
with the pattern USER@bitbucket.org, after trying with git @bitbucket.org everything worked.git clone
与模式 USER@bitbucket.org 一起使用,在尝试使用git @bitbucket.org 后一切正常。 I hope this helps someone with the same problem i had.我希望这可以帮助我遇到同样问题的人。
I found similiar problem and the solution is here我发现了类似的问题,解决方案在这里
https://confluence.atlassian.com/bitbucketserverkb/ssh-rsa-key-rejected-with-message-no-mutual-signature-algorithm-1026057701.html https://confluence.atlassian.com/bitbucketserverkb/ssh-rsa-key-rejected-with-message-no-mutual-signature-algorithm-1026057701.html
I just added two properties, IdentitiesOnly
and PubkeyAcceptedKeyTypes
in ssh config.我刚刚在 ssh 配置中添加了两个属性,
IdentitiesOnly
和PubkeyAcceptedKeyTypes
。
Host bitbucket.org
HostName bitbucket.org
IdentityFile /home/me/.ssh/id_rsa_bitbucket
IdentitiesOnly yes
PubkeyAcceptedKeyTypes +ssh-rsa
Please note that there is security concern regarding this solution as mentioned in the link above请注意,如上面的链接所述,此解决方案存在安全问题
这个答案比公认的答案更能帮助我解决这个确切的问题: Git 在错误的位置寻找我的 SSH 密钥
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.