Git连接Github是遇到的问题


ssh -T [email protected] 报错

Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
这个需要修改,/etc/hosts,加上下面这行:

 192.30.253.113 github.com


ssh -T [email protected] 报错

“Permission denied (publickey).”

用这个命令查看一下,

 ssh -T -v [email protected]

最后几行就是问题所在:

debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /c/Users/xuan/.ssh/id_rsa
debug1: Trying private key: /c/Users/xuan/.ssh/id_dsa
debug1: Trying private key: /c/Users/xuan/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/xuan/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).


在.ssh文件夹中找不到id_rsa文件。我的是因为生成在外层文件夹而且文件名也不对。

所以拷贝到.ssh文件夹即可。一共有两个文件id_rsa, id_rsa.pub。

还有一个known_hosts文件,有用,放那即可。

发布了90 篇原创文章 · 获赞 3 · 访问量 21万+

猜你喜欢

转载自blog.csdn.net/sunnyboychina/article/details/52576318
今日推荐