前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repo

ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repo

作者头像
IT云清
发布2020-02-14 15:49:19
2.8K0
发布2020-02-14 15:49:19
举报
文章被收录于专栏:IT云清IT云清
1.问题

换了个wifi,git clone拉取代码就会报错,切回原来的wifi,又是可以的,反复尝试,最终确认,这个特定的wifi下,网页和命令行都不能访问github,甚是神奇。

代码语言:javascript
复制
G:\mylearn\source-code>git pull
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

G:\mylearn\source-code>ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out
在这里插入图片描述
在这里插入图片描述
2.解决方案:

在C:\Users\wangzx\.ssh目录下,也就是放这个的目录下:

在这里插入图片描述
在这里插入图片描述

创建一个文件,config,不需要后缀名,内容为:

代码语言:javascript
复制
Host github.com
User xxxyouremail@qq.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

添加完后如下:

在这里插入图片描述
在这里插入图片描述
代码语言:javascript
复制
G:\mylearn\source-code>ssh -T git@github.com
The authenticity of host '[ssh.github.com]:443 ([192.30.253.122]:443)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[ssh.github.com]:443,[192.30.253.122]:443' (RSA) to the list of known hosts.
Hi lightClouds917! You've successfully authenticated, but GitHub does not provide shell access.

G:\mylearn\source-code>ssh -T git@github.com
Hi lightClouds917! You've successfully authenticated, but GitHub does not provide shell access.

G:\mylearn\source-code>git pull
Warning: Permanently added the RSA host key for IP address '[192.30.253.123]:443' to the list of known hosts.
Already up-to-date.

G:\mylearn\source-code>git pull
Already up-to-date.

搞定!

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-01-30 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1.问题
  • 2.解决方案:
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档