解決碼雲 [email protected]: Permission den
Git 操作碼雲專案出現問題: [email protected]: Permission denied (publickey)
小烏龜(TortoiseGit)出現問題: Disconected: No supported authentication methods
解決方法:
碼雲提供了基於SSH協議的Git服務,在使用SSH協議訪問專案倉庫之前,需要先配置好賬戶/專案的SSH公鑰。
1. 重新生成 ssh 公鑰
以下內容來自碼雲官網內容 : https://gitee.com/help/articles/4181
1). 你可以在Git Bash中執行如下命令來生成 sshkey: ( "[email protected]" 為碼雲註冊郵箱) 按照提示完成三次回車,即可生成 ssh key
ssh-keygen -t rsa -C "[email protected] "
2). 通過檢視 ~/.ssh/id_rsa.pub
檔案內容,獲取到你的 public key
在Git Bash中執行如下命令即可顯示 public key
cat ~/.ssh/id_rsa.pub
3). 首次使用需要確認並新增主機到本機SSH可信列表。執行以下命令,若返回 ( Hi XXX! You've successfully authenticated, but Gitee.com does not provide shell access.)
內容,則證明新增成功。
ssh -T [email protected]
2. 將新生成的公鑰新增到 碼雲賬戶裡的 SSH-KEY中
碼雲新增公鑰: https://gitee.com/profile/sshkeys
3. 按1, 2步驟執行後, Git 中對碼雲倉庫的操作沒問題了,
如果 Tortoisegit 報錯:Disconected: No supported authentication methods
解決: 將小烏龜的SSH客戶端換成Git安裝目錄下的 \usr\bin\ssh.exe
設定好後, 問題解決
碼雲幫助文件: https://git.mydoc.io/?t=135440