Github--------------连接github超时问题(ssh: connect to host github.com port 22: Connection timed out)

1.在连接github的时候,遇到了一个特别难解决的问题:ssh: connect to host github.com port 22: Connection timed out,网上看了好多,但是依旧没有解决。下面来试一下我这种方式

2.连接超时,首先找到git的安装目录,找到/etc/ssh/ssh_config文件
这里写图片描述

3.用notepad++打开这个文件,如下图:
这里写图片描述

4.把如下内容复制到ssh_config文件的末尾处:并记得保存
1)Host github.com
User git //写上自己的登录名或者邮箱
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
如图:这里写图片描述
2)这时在
C:\Users\Hailong.ssh这个目录下就会自动生成一个文件这里写图片描述
基本上就可以成功了

5.再使用:ssh -T [email protected]来测试git是否成功连接github

猜你喜欢

转载自blog.csdn.net/qq_41166135/article/details/81282572
今日推荐