SourceTree正確配置SSH key之后仍然提示fatal: Could not read from remote repository.

如題,按照網(wǎng)上的配置SSHkey (不知道的可以百度搜索MAC Git SSH 配置)后,使用sourcetree 仍然出現(xiàn)如下問題:

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.

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.

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.

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.

最后總結(jié)一下,常規(guī)配置完成后一定要執(zhí)行 ssh-add id_rsa,然后重新再試一下,妥了,下面附上完整配置SSH key流程

完整步驟

$ cd? ~/.ssh

$ ssh-keygen -t rsa -C 你的郵箱? ? ? ?? #此時(shí)會(huì)讓你輸入文件名,私鑰文件訪問密碼,ssh目錄下會(huì)生成兩個(gè)文件,可使用ls命令查看

$ cat id_rsa.pub? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ????? #查看公鑰,復(fù)制到GitHub添加ssh key

$ ssh -T git@github.com? ? ? ? ? ? ? ? ? ? ?? #驗(yàn)證

Hi XXXX! You've successfully authenticated, but GitHub does not provide shell access.

$ ssh-add id_rsa

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容