簡體   English   中英

Bitbucket 權限被拒絕(公鑰)。 但適用於 ssh

[英]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

一些額外的信息:

  • 我已經在我的 Bitbucket 帳戶中包含了公鑰
  • 我的密鑰位於~/.ssh/
  • 我沒有用 sudo 運行
  • 命令ssh-add -l返回正確的密鑰。 (RSA)

我能夠完成這項工作,但是我的 git 實現存在多個問題:

  • 我試圖訪問組織存儲庫,但我將公鑰添加到我的主帳戶。
  • 我試圖將git clone與模式 USER@bitbucket.org 一起使用,在嘗試使用git @bitbucket.org 后一切正常。

我希望這可以幫助我遇到同樣問題的人。

我發現了類似的問題,解決方案在這里

https://confluence.atlassian.com/bitbucketserverkb/ssh-rsa-key-rejected-with-message-no-mutual-signature-algorithm-1026057701.html

我剛剛在 ssh 配置中添加了兩個屬性, IdentitiesOnlyPubkeyAcceptedKeyTypes

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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM