git 報錯Could not read from remote repository. Please make sure you have the correct access rights an

最近在拉取github、gitlab中的項目時,git 報了這樣的錯誤,錯誤很簡單,但是也是常碰到的

Warning: Permanently added the RSA host key for IP address '13.250.177.223' to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

這個錯誤就是說沒有訪問權限或者不存在這個遠程倉庫,這時需要

生成祕鑰文件

ssh-keygen -t rsa -b 4096 -C "[email protected]"

id_rsa
id_rsa.pub
known_hosts

打開id_rsa.pub

將公鑰複製添加到對應的gitlab /github倉庫中即可

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章