github连接报"ssh: connect to host github.com port 22: Connection timed out"错误

196 阅读1分钟
  1. 异常 在连接github时,执行”ssh -T git@github.com” 命令时,出现

ssh: connect to host github.com port 22: Connection timed out 1 2. 解决方法 在存放公钥私钥(id_rsa和id_rsa.pub)的文件里,新建config文件,内容如下:

Host github.com
User YourEmail@163.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

其中YourEmail@163.com是你的git邮箱。 再次执行”ssh -T git@github.com”时,会出现提示如下,回车”yes”即可。

这时验证就可以通过。

———————————————— 版权声明:本文为CSDN博主「Vosang」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:blog.csdn.net/vosang/arti…