我是靠谱客的博主 激昂店员,这篇文章主要介绍ssh: connect to host github.com port 22: Connection timed out,现在分享给大家,希望可以做个参考。

转载自:https://blog.csdn.net/weixin_39800144/article/details/104118750

问题

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

复制代码
1
2
3
4
5
6
7
8
9
10
G:mylearnsource-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:mylearnsource-code>ssh -T git@github.com ssh: connect to host github.com port 22: Connection timed out

在这里插入图片描述

解决方案:

在C:Userswangzx.ssh目录下,也就是放这个的目录下:
在这里插入图片描述
创建一个文件,config,不需要后缀名,内容为:

复制代码
1
2
3
4
5
6
7
Host github.com User xxxyouremail@qq.com Hostname ssh.github.com PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa Port 443

添加完后如下:
在这里插入图片描述

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
G:mylearnsource-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:mylearnsource-code>ssh -T git@github.com Hi lightClouds917! You've successfully authenticated, but GitHub does not provide shell access. G:mylearnsource-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:mylearnsource-code>git pull Already up-to-date.

搞定!

最后

以上就是激昂店员最近收集整理的关于ssh: connect to host github.com port 22: Connection timed out的全部内容,更多相关ssh:内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(81)

评论列表共有 0 条评论

立即
投稿
返回
顶部