从远程库github.com克隆代码时遇到了如下的问题:

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.

 

这个应该是很多github新手经常出错的问题,这个就是没有在你github上添加一个公钥

1.可以用: ssh-keygen -t rsa -C “GitHub账号” ,一直Enter下去生成公钥如下所示

 

 

2..然后用:cat+公钥路径,把出现的key复制下来

 

 

3.在 github 上添加刚刚生成的公钥

 

Tags: