開始使用 NixOS 作為新的包管理系統后,在 Azure DevOps 存盤庫和 rsa ssh 密鑰中使用 git 時出現以下錯誤:
jaroslavbezdek@mac> git pull
Unable to negotiate with 40.74.28.9 port 22: no matching host key type found. Their offer: ssh-rsa
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
請問我能用它做什么?
uj5u.com熱心網友回復:
使用 SSH,有幾種不同型別的密鑰,而 RSA 密鑰(ssh-rsa)型別可以支持多種簽名。簽名型別ssh-rsa是指帶有 SHA-1 的 RSA,而簽名型別rsa-sha2-256是帶有 SHA-256rsa-sha2-512的 RSA 和帶有 SHA-512 的 RSA。
在 Azure DevOps 的情況下,它只支持帶有 SHA-1 的那種 RSA,而 SHA-1 被認為是非常弱的。這基本上意味著沒有安全的方法可以通過 SSH 連接到它,在他們解決這個問題之前,你最好使用 HTTPS 或其他托管服務。GitHub、GitLab 和 Bitbucket 都支持安全的身份驗證方法。
如果您目前確實需要將 SSH 與 Azure DevOps 結合使用,您可以在~/.ssh/config檔案中添加一個條目來解決此問題:
Host ssh.dev.azure.com
User git
PubkeyAcceptedAlgorithms ssh-rsa
HostkeyAlgorithms ssh-rsa
但是,請注意,這是一種變通方法,并且已知它不安全,因此您應該就此問題聯系 Azure DevOps 并切換到 HTTPS,直到他們這樣做為止,或者轉移到其他地方。
uj5u.com熱心網友回復:
根據這篇文章:
最終
~/.ssh/config對我有用:Host ssh.dev.azure.com HostName ssh.dev.azure.com User git IdentityFile ~/.ssh/id_rsa IdentitiesOnly yes PubkeyAcceptedAlgorithms ssh-rsa HostkeyAlgorithms ssh-rsa
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/354950.html
標籤:混帐 azure-devops rsa 尼克斯
上一篇:合并來自“嵌入式”上游專案的更改
下一篇:別名洗掉本地分支并再次創建同名
