日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

git@github.com:Permission denied(publickey).fatal: Could not read form remote repository错误

發布時間:2025/3/11 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 git@github.com:Permission denied(publickey).fatal: Could not read form remote repository错误 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

文章目錄

  • 前言
  • 問題分析
  • 解決方法
    • 配置客戶端
    • 配置服務端
    • 驗證

前言

在使用goland從github下載依賴時(git clone github.com/gin-gonic/gin)出現git@github.com:Permission denied(publickey).fatal: Could not read form remote repository錯誤。

問題分析

Permission denied(publickey):沒有權限
說明github和本地git沒有生成ssh key或者ssh key不匹配

解決方法

配置客戶端

  • 客戶端(本文為windows10電腦),打開git bash,執行ssh-keygen -t rsa -C "github登錄郵箱"

    然后一路回車(不用輸入)。
  • 在git bash執行ssh -v git@github.com
    出現下方文字No more authentication methods to try. Permission denied(publickey) 如圖:
  • 在git bash執行ssh-agent -s,如圖
  • 在git bash執行ssh-add ~/.ssh/id_rsa,如圖

    出現Could not open a connection to your authentication agent警告
    在git bash執行ssh-agent bash命令,然后再次執行ssh-add ~/.ssh/id_rsa

    Identity added: /c/Users/zhandongyang/.ssh/id_rsa,這是ssh key文件在windows電腦上的位置,用記事本打開這個路徑上的id_rsa.pub文件,復制里面的內容。
  • 配置服務端

  • 本文的服務端為github,訪問github網站、登錄,點擊右上角的頭像,然后點擊Settings
  • 選擇SSH and GPG keys,選擇New SSH key

    Title寫個自己記得住的名字,Key填寫復制的id_rsa.pub文件內容
  • 驗證

    在客戶端(本文為windows10電腦)的git bash執行ssh -T git@github.com

    至此結束。

    總結

    以上是生活随笔為你收集整理的git@github.com:Permission denied(publickey).fatal: Could not read form remote repository错误的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。