Git提交錯誤:Permission denied (publickey),fatal: Could not read from remote reposito

錯誤提示:git

Permission denied (publickey).ssh

fatal: Could not read from remote repository.google

Please make sure you have the correct access rights3d

and the repository exists.cdn

image.png

沃德天,誰動我電腦了,昨天還好好的~~~~~blog

昨天->操做過id_rsa_pub文件rem

是誰???這麼不要臉it

好像是我。。。io

好吧從新配置下公鑰:class

執行:ssh-keygen -t rsa -C 「郵箱地址」

image.png

而後出現: Enter file in which to save the key (/Users/wyd/.ssh/id_rsa):(公鑰名稱,默認是 id_rsa.pub)

以前鏈接別的從新生成了id_rsa.pub,就是沒有寫名字一路回車爽啊,以前的id_rsa.pub被新的覆蓋了,以後杯具就是沒法鏈接git了

因此咱們這裏寫test(我是隨便起的,大家隨意)

image.png

而後一路回車吧

來看生成的文件:

image.png

最後關鍵的一步:將本身起的名字加入到ssh中

ssh-add ~/.ssh/test

而後複製test.pub內容到git的ssh文件中,這樣就妥了

插曲:記得去掉文件的換行,怎麼換——>google

相關文章
相關標籤/搜索