当前位置:   article > 正文

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

ssh github network error: 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 git@github.com来测试git是否成功连接github

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/小舞很执着/article/detail/927334
推荐阅读
相关标签
  

闽ICP备14008679号