ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repo [复制链接]
发表于 2026-4-8 07:56:49 | 显示全部楼层 |阅读模式
题目形貌

之前利用 Git 推送本地堆栈至远程堆栈时没题目,本日忽然出现了这个错误,利用了“黑科技”之后仍旧还会出现这个错误。(从前也碰到过,但都是网络题目,本身就好了)

查抄毗连

1. 起首输入以下下令查抄SSH是否可以或许毗连乐成(ssh背面有空格)
  1. ssh -T git@github.com
复制代码
发现报错:端口毗连超时。
  1. ssh: connect to host github.com port 22: Connection timed out
复制代码
办理方案

在C盘——用户——你的主机名文件夹中找到 .ssh 文件夹;(此前设置SSH时会天生该文件夹)
在 .ssh 文件夹中新建文件 config.txt ,输入以下内容,将 xxxxqq.com 更改为你的邮箱,并生存。 
末了,去掉 .txt 后缀
  1. Host github.com
  2. User xxxxqq.com
  3. Hostname ssh.github.com
  4. PreferredAuthentications publickey
  5. IdentityFile ~/.ssh/id_rsa
  6. Port 443
复制代码

再次实行
  1. ssh -T git@github.com
复制代码
会出现以下提示,输入 yes 回车即可
  1. The authenticity of host '[ssh.github.com]:443 ([192.30.255.123]:443)' can't be established.
  2. RSA key fingerprint is SHA256:xxx.
  3. Are you sure you want to continue connecting (yes/no)? yes
  4. Warning: Permanently added '[ssh.github.com]:443,[192.30.255.123]:443' (RSA) to the list of known hosts.
复制代码
再次实行 ssh -T git@github.com,发现验证通过
  1. Hi Clare! You've successfully authenticated, but GitHub does not provide shell access.
复制代码
接下来可以正常上传代码


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

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!qidao123.com:ToB企服之家,中国第一个企服评测及软件市场,开放入驻,技术点评得现金

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表