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

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

背景

可能是中国内地网络环境的原因,Git通过ssh推送到自己的存储库发生以下错误。大概是github.com的22端口被屏蔽了?

root@yst-ubuntu:~/dev-chaos-test-system/chaos-test-system# git push origin dev
ssh: connect to host github.com port 22: Connection refused
fatal: Could not read from remote repository.

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

通过HTTPS也不行,以下错误提示大意是 2021-08-13 密码认证被移除了。官方中文文档 文档里似乎没说密码认证被移除这回事

root@yst-ubuntu:~/dev-chaos-test-system/chaos-test-system# git push hub_https dev
Username for 'https://github.com': YuSitong1999
Password for 'https://YuSitong1999@github.com': 
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/YuSitong1999/chaos-test-system.git/'

解决

官方文档: 在 HTTPS 端口使用 SSH

链接格式和GitHub提供的前两条HTTPS和SSH链接不一样。文章来源地址https://www.toymoban.com/news/detail-816532.html

https://github.com/YuSitong1999/chaos-test-system.git
git@github.com:YuSitong1999/chaos-test-system.git

ssh://git@ssh.github.com:443/YuSitong1999/chaos-test-system.git

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

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

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

相关文章

  • 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日
    浏览(38)
  • Git提交 ssh: connect to host github.com port 22: Connection timed out解决方案

    你们好,我是金金金。 之前都是好好的,不知道今天为什么提交代码就这样了 根据英文可以看出,ssh端口号被拒绝了,22号端口不行,那就换一个端口 ssh端口被拒绝 找到.ssh文件,在下面创建一个config文件,然后记事本打开写入以下内容 成功提交 主要是ssh 22端口被拒绝,我

    2024年01月22日
    浏览(50)
  • 【git】解决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被封锁。 创建一个config文件 将下面的内容复制进去 保存退出 检查是否成功 这里要根据它的提示操作,有个

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

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

    2024年02月08日
    浏览(35)
  • 解决 Git:ssh: connect to host github.com port 22: Connection timed out 问题的三种方案

    其一、整体提示为: ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository. 中文为: ssh:连接到主机 github.com 端口 22:连接超时 fatal:无法从远程存储库读取 其二、问题描述为: A、正常的将代码提交到 git 仓库的过程: step1、找到要提交 git 的代

    2024年01月25日
    浏览(44)
  • 终极办法!connect to host port 22: Connection timed out git@ssh.github.com: Permission denied (publickey

    过了个周末git突然用不了了,在拉代码的时候突然报错连接超时,又报错说没有权限,这就很烦了 在百度了很久以后尝试了各种办法,重新生成pub_key,重装git等等都没能解决,最后询问了公司大佬,困扰了一个上午的问题终于解决了 先说说百度上的解决办法: 使用命令 s

    2024年02月04日
    浏览(44)
  • $ git push ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from

    之前都好好的,今天 git push 突然出现这个问题 解决方法一:改用HTTP协议(我没试过,应该是可以的) 就是把远程库地址改成HTTP协议的,好像是这个命令,自己搜一下 git remote set-url origin https://username@github.com/username/repository.git 解决方法二:更改SSH端口 (亲测可用) 先试试

    2024年01月20日
    浏览(44)
  • 【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日
    浏览(43)
  • ssh: connect to host github.com port 22: Connection refused

    最近使用 git 拉取 Github 上的项目时老是出现 Connection refused : 网上的解决办法 解决ssh: connect to host github.com port 22: Connection refused 但是在使用了这个方法后依然无法解决: 然后看见隔壁工位上大哥的搜索栏上赫然也是这个问题,交流一番应该是最近墙比较敏感的问题。 解决方

    2024年02月13日
    浏览(32)
  • 解决ssh: connect to host github.com port 22: Connection refused

    ssh: connect to host github.com port 22: Connection refused 是连接github.com的端口号22拒绝连接。 可以使用github的443端口。 解决方案 在 ~/.ssh/config 中添加如下字段: 测试是否链接成功 如果出现如下字段则验证成功 The authenticity of host ‘[ssh.github.com]:443 ([20.205.243.160]:443)’ can’t be establishe

    2024年01月22日
    浏览(34)

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

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

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

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

二维码1

领取红包

二维码2

领红包