Windows10 下 github ssh 訪問出現 Permission denied(publickey)錯誤的解決方法


Windows10 下 github ssh 訪問出現 Permission denied(publickey)錯誤的解決方法。

  • 錯誤信息:

    git clone git@github.com:ediwang/envsetup.git
    Cloning into 'envsetup'...
    git@github.com: Permission denied (publickey).
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    
  • 解決方法:

    • 打開 services.msc , 找到 OpenSSH Authentication Agent 服 務,然后啟用它。

    • 進入 .ssh 目錄

    • 執行 ssh-agent -s

    • 執行 ssh-add id_rsa (id_rsa 要換成自己的)

    • 執行 ssh -T git@github.com,如果出現:
      Hi molisiye! You've successfully authenticated, but GitHub does not provide shell access. 就說明可以通過 ssh 訪問 github 了


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM