ssh: connect to host github.com port 22: Connection refused fatal: Could not read from remote reposi...

这篇具有很好参考价值的文章主要介绍了ssh: connect to host github.com port 22: Connection refused fatal: Could not read from remote reposi...。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

ssh: connect to host github.com port 22: Connection refused fatal: Could not read from remote repository 报错解决

今天 github 提交代码时,git pull 出现错误:ssh: connect to host github.com port 22: Connection refused fatal: Could not read from remote repository。 可以使用 git push 把自己的代码提交到远程,但是不能 pull。这个情况之前没有遇到过。

这个报错信息翻译时:ssh:连接到主机github.com端口22:连接拒绝:无法从远程存储库读取。

查询资料后,在栈溢出中找到解决方案:因为我在公共的WiFi环境中(我在肯德基敲代码),这个公共WIFI可能拒绝了SSH端口, 所以pull代码失效。

解决方案:在SSH配置文件中,设置github的主机名为 ssh.github.com 设置443端口

vim ~/.ssh/config

~m'd Host github.com Hostname ssh.github.com Port 443 ~

这样就可以 git pull 了。

原始链接

https://stackoverflow.com/questions/7953806/github-ssh-via-public-wifi-port-22-blocked文章来源地址https://www.toymoban.com/news/detail-533871.html

到了这里,关于ssh: connect to host github.com port 22: Connection refused fatal: Could not read from remote reposi...的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Git推送到Guthub错误:ssh: connect to host github.com port 22: Connection refused

    可能是中国内地网络环境的原因,Git通过ssh推送到自己的存储库发生以下错误。大概是github.com的22端口被屏蔽了? 通过HTTPS也不行,以下错误提示大意是 2021-08-13 密码认证被移除了。官方中文文档 文档里似乎没说密码认证被移除这回事 官方文档: 在 HTTPS 端口使用 SSH 链接格

    2024年01月23日
    浏览(63)
  • 【Git 教程系列第 27 篇】ssh: connect to host github.com port 22: Connection refused 的解决方案

    这是【Git 教程系列第 27 篇】,如果觉得有用的话,欢迎关注专栏。 一:问题描述 自己的一个 git 项目,昨天在公司正常 push 的时候,提示文字信息如下 提示截图信息如下 有人说是因为开了代理的原因,不过之前我开着代理提交是没有问题的,但还是试了一试,可惜并没有

    2024年02月08日
    浏览(19)
  • ssh: connect to host github.com port 22: Connection refused fatal: Could not read from remote reposi...

    今天 github 提交代码时,git pull 出现错误:ssh: connect to host github.com port 22: Connection refused fatal: Could not read from remote repository。 可以使用 git push 把自己的代码提交到远程,但是不能 pull。这个情况之前没有遇到过。 这个报错信息翻译时:ssh:连接到主机github.com端口22:连接拒绝

    2024年02月13日
    浏览(440)
  • 【git】ssh: connect to host github.com port 22: Connection refused fatal: Could not read from remote r

    之前github的ssh的公私钥已经配置好,并可以正常使用,可没过多久,有一天突然报错: ssh: connect to host github.com port 22: Connection refused fatal: Could not read from remote repository. git 远程仓库两种协议:ssh,https。 在解决问题之前,先要了解git远程仓库的两种协议连接。 ssh协议连接gi

    2024年01月20日
    浏览(23)
  • 解决 ssh: connect to host github.com port 22: Connection timed out

    今天使用git克隆github上的代码时,一直报错 原以为是公钥过期了,就尝试修改配置公钥,但是尝试了几次都不行,最终在博客上找到了解决方案,在次记录一下,以备不时之需 解决ssh-connect-to-host-github-com-port-22-connection-timed-out_ssh connection time out-CSDN博客 找到.ssh文件夹,创建

    2024年01月24日
    浏览(25)
  • Git解决“ssh:connect to host github.com port 22: Connection timed out”

    第一次配置github 的ssh,原来使用过gitee的ssh,才知道他们用的都是一个。 我已经有ssh key .位置在 C:Usersjiang.sshid_rsa.pub 点击头像setting就可以,我这里已经粘贴了。 我在桌面右键 git bash here,或cmd也可以,还有一个power shell,我其实都搞不懂区别。 我的运行 通过查阅各种资料

    2024年02月04日
    浏览(23)
  • github 推送报错 ssh: connect to host github.com port 22: Connection timed out 解决

    🚀 作者主页: 有来技术 🔥 开源项目: youlai-mall 🍃 vue3-element-admin 🍃 youlai-boot 🌺 仓库主页: Gitee 💫 Github 💫 GitCode 💖 欢迎点赞 👍 收藏 ⭐留言 📝 如有错误敬请纠正! git push 推送 github 报错如下: 找到 .ssh 文件夹新增 config 配置文件 添加以下配置即可 使用 ssh -T g

    2024年01月25日
    浏览(25)
  • 解决git报错:ssh:connect to host github.com port 22: Connection timed out

    如题,git使用中突然报错 ssh:connect to host github.com port 22: Connection timed out 通过查阅各种资料,得知原因可能是由于电脑的防火墙或者其他网络原因导致ssh连接方式 端口22被封锁。 一:抛弃ssh连接方式,使用http连接。 进入.ssh文件夹   创建一个config文件 将下面的内容复制进去

    2024年02月16日
    浏览(20)
  • Git问题:解决“ssh:connect to host github.com port 22: Connection timed out”

    操作系统 Windows11 使用Git IDEA 连接方式:SSH 今天上传代码出现如下报错:ssh:connect to host github.com port 22: Connection timed out 再多尝试几次,依然是这样。 最终发现两个解决方案:(二选一) 方法一: 抛弃ssh连接方式,使用http连接。(我试了一下,对于我来说没有用) 操作方法

    2024年02月10日
    浏览(19)
  • git报错处理:ssh:connect to host github.com port 22: Connection timed out

    git 在上传、下载 文件的时候,报错。 报错信息: ssh:connect to host github.com port 22: Connection timed out 提示这个域名github.com port 的22 端口,链接超时。 我直接访问github.com 这个域名是可以访问的,ping 也是可以ping通的。 使用telnet 链接github.com 的22 端口,报超时错误。 所以,问题

    2024年02月11日
    浏览(17)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包