[英]Bitbucket Permission denied (publickey). but works with ssh
你好,如果我嘗試使用 ssh 連接到 bitbucket.org
ssh -vT git@bitbucket.org
一切正常
debug1: Authentication succeeded (publickey).
但是,如果我嘗試使用git clone
命令,我會收到此消息:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
一些額外的信息:
~/.ssh/
ssh-add -l
返回正確的密鑰。 (RSA)我能夠完成這項工作,但是我的 git 實現存在多個問題:
git clone
與模式 USER@bitbucket.org 一起使用,在嘗試使用git @bitbucket.org 后一切正常。我希望這可以幫助我遇到同樣問題的人。
我發現了類似的問題,解決方案在這里
我剛剛在 ssh 配置中添加了兩個屬性, IdentitiesOnly
和PubkeyAcceptedKeyTypes
。
Host bitbucket.org
HostName bitbucket.org
IdentityFile /home/me/.ssh/id_rsa_bitbucket
IdentitiesOnly yes
PubkeyAcceptedKeyTypes +ssh-rsa
請注意,如上面的鏈接所述,此解決方案存在安全問題
這個答案比公認的答案更能幫助我解決這個確切的問題: Git 在錯誤的位置尋找我的 SSH 密鑰
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.