Permission denied (publickey). fatal: Could not read from remote repository

轉載請標明出處:http://blog.csdn.net/donkor_/article/details/77502800

前言

Warning: Permanently added the RSA host key for IP address '192.29.255.115' to the list of known hosts. 
Permission denied (publickey). 
fatal: Could not read from remote repository. 
Please make sure you have the correct access rights and the repository exists

今天在上傳項目到github時候,出現了上述描述的錯誤。這個應該是很多github新手經常出錯的問題,其實就是沒有在你github上添加一個公鑰。

▲ 解決方案(圖文教程)
1 . 使用 ssh -T [email protected] 測試一下,得到Permission denied(publickey).意思表示缺少公鑰。

ssh -T git@github.com

2 . 輸入ssh-keygen -t rsa -C "ChenYXin",之後猛擊下一步(Enter),當看到RSA 2048的框框時,表示成功生成公鑰。ChenYXin是我本人的github賬號。記住保存公鑰的地址,第三步要用。

ssh-keygen -t rsa -C "ChenYXin"

3 . cat 一下第二步保存的公鑰地址,在控制檯將公鑰複製下來。

cat in /User/~~/.ssh/id_rsa.pub

4 . 登錄github賬號,添加剛剛複製的公鑰
step one

step two

step three

step four
這裏的title並不重要,可不填

▲ 如果還沒解決,要不您換個姿勢再試試(google)


About me
Email :[email protected]
Android開發交流QQ羣 : 537891203
Android開發交流羣

發佈了89 篇原創文章 · 獲贊 316 · 訪問量 41萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章