最近在拉取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倉庫中即可