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

ssh: connect to host github.com port 22: Connection timed out


1.异常

在连接github时,执行”ssh -T git@github.com” 命令时,出现

ssh: connect to host github.com port 22: Connection timed out

2.解决

在存放公钥私钥(id_rsa和id_rsa.pub)的文件里,新建config文本,内容如下:

1.Host github.com
2.User YourEmail@163.com
3.Hostname ssh.github.com
4.PreferredAuthentications publickey
5.IdentityFile ~/.ssh/id_rsa
6.Port 443

其中User为登录github的账号名称。
再次执行”ssh -T git@github.com”时,会出现提示如下,回车”yes”即可。
github连接报"ssh: connect to host github.com port 22: Connection timed out"错误
这时验证就可以通过。
github连接报"ssh: connect to host github.com port 22: Connection timed out"错误

总结自:https://blog.csdn.net/vosang/article/details/50499300

上一篇:Error: pngquant failed to build, make sure that libpng-dev is installed


下一篇:alsa-lib、alsa-utils编译