首页 > 其他分享 >GitHub-fatal-unable-to-access-https-github-com-Failed-to-connect-to-github-com-port-443-Operation-ti

GitHub-fatal-unable-to-access-https-github-com-Failed-to-connect-to-github-com-port-443-Operation-ti

时间:2023-11-12 09:33:20浏览次数:30  
标签:GitHub -- github ssh https git com

title: >-
  [GitHub] fatal: unable to access 'https://github.com/': Failed to connect to
  github.com port 443: Operation timed out
tags: [github,git]
categories: github
date: 2021-11-23 11:11:00

2021年11月,由于众所周知的缘故,连接到github越来越微妙,分享一些MAC平台上的解题思路,希望对你有帮助:

Errors

Notes:

Don't verify the operation in editor(WebStorm,IntelliJ IDEA...etc), use command(Mac's terminal.app), use terminal.app


Solutions for: Operation timed out

  1. Fix the hosts to make sure the ssh connection between your Computer and github.com is availble(修复连接到github.com)

Verify Standard 判断标准:$ ssh -T [email protected]

1.1 记录下github的IP地址, 把IP Address 记录下来

打开https://github.com.ipaddress.com/

打开https://fastly.net.ipaddress.com/github.global.ssl.fastly.net#ipinfo

打开https://github.com.ipaddress.com/assets-cdn.github.com

1.2 打开电脑的hosts文件(/private/etc/hosts),把下列的地址对应写入,然后保存即可(version2021.11.23)

# Github Start. Updated 20211123/CZ 140.82.113.3 github.com 199.232.69.194 github.global.ssl.fastly.net 185.199.108.153 assets-cdn.github.com 185.199.109.153 assets-cdn.github.com 185.199.110.153 assets-cdn.github.com 185.199.111.153 assets-cdn.github.com

Github End

1.3 在终端在输以下指令刷新DNS(需要权限)

sudo killall -HUP mDNSResponder

1.4 如果之前用ssh proxy,取消它

git config --global http.proxy http://127.0.0.1:1080 
git config --global https.proxy http://127.0.0.1:1080 
git config --global --unset http.proxy
git config --global --unset https.proxy

1.5 重新尝试 ping github.com. 重新尝试 ssh -T [email protected]

新的错误可能和授权有关,至少证明连接到github.com是通的。


Solutions for: Authentication

  1. Create new Token and login to github.com (新建密钥并登陆进github.com)

Verify Standard 判断标准:$ git pull

2.1 Creating a personal access token at https://github.com/settings/tokens

授权_admin:org, admin:public_key, admin:repo_hook, gist, read:user, repo, write:packages_

具体步骤:https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

2.2 Terminal.app 命令行,运行 git pull(先要cd 到原来的git 根目录)

Username for 'https://github.com':  (这个地方输入登录github网址用的用户名,我的是用9个英文字母)
Password for 'https://***@github.com':  (这个地方要是输入#2.1中得到的Token)

2.3 判断一下连接和授权,如果需要ssh连接,继续添加配置以下。

2.4 生成ssh密钥。Generating a new SSH key and adding it to the ssh-agent。具体步骤简要如下:

$ ssh-keygen -t ed25519 -C "your\[email protected]"

> Enter a file in which to save the key (/Users/you/.ssh/id\_algorithm): \[Press enter\] \> Enter passphrase (empty for no passphrase): \[Type a passphrase\] \> Enter same passphrase again: \[Type passphrase again\] \---------------------------------------------------- $ eval "$(ssh-agent -s)"
> Agent pid 59566

---------------------------------------------------- $ touch ~/.ssh/config  
加入以下内容:
Host \* AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id\_ed25519 \---------------------------------------------------- $ ssh\-add -K ~/.ssh/id\_ed25519

2.5 协助排查:github服务端的日志,显示有用的连接信息,用来验证链路是否握手成功等等

https://github.com/settings/security-log

尽量把验证都放在命令行中,这样更高效直接(在IDE中操作,在验证太费劲了),terminal成功以后,IDEA会自动也成功,因为它们分享相同的配置(git 根目录下面有.git的配置目录)

参见文档:

https://juejin.cn/post/6844904193170341896

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/

Node.js也被同样错误卡

hexo d
...
fatal: unable to access 'https://github.com/@@@@@.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
...

{% tabs 尝试%}

git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy http://127.0.0.1:1080
重试hexo d

git config --global --unset http.proxy
git config --global --unset https.proxy
重试hexo d

{% endtabs %}

解决办法后来是因为hexo没有检测到内容变动,不去push。
hexo clean
然后在 hexo g && hexo d 就解决了

标签:GitHub,--,github,ssh,https,git,com
From: https://www.cnblogs.com/backuper/p/17826768.html

相关文章

  • High-performance computing (HPC)
    ConceptsdiscriminationWhatistherealtionshipsamongparallelcomputing,high-performancecomputingandsupercomputing?parallelcomputing:usingmultiplecomputingcoretocomputeajobhigh-performancecomputing:atypeofparallelcomputing,an......
  • 设计模式--Command模式
    命令模式(CommandPattern)是一种行为设计模式,它将一个请求封装为一个对象,从而使你可以用不同的请求对客户进行参数化,对请求排队或记录请求日志,以及支持可撤销的操作。命令模式主要包含以下几个角色:Command(抽象命令类):声明执行操作的接口。ConcreteCommand(具体命令类):是一个具体的......
  • 无涯教程-批处理 - NET COMPUTER函数
    添加或删除连接到Windows域控制器的计算机。NETCOMPUTER-语法NETCOMPUTER\\computername{/ADD|/DEL}NETCOMPUTER-示例NETCOMPUTER\\dxbtest/ADD上面的命令会将名称为dxbtest的计算机添加到Windows域控制器所在的域中。参考链接https://www.learnfk.com/batch-......
  • 数组的sort方法接受一个比较函数:compareFun(a, b); 如果返回的值>0,则调换a,b位置,即b的
    现有一组人员年龄的数据,要求将这些人员的年龄按照从小到大的顺序进行排列起来,要怎样来实现AfunctionnumberSort(a,b){returna-b;}vararr=newArray("23","6","12","35","76");document.write(arr.push(numberSort));BfunctionnumberSort(a,b){retu......
  • Github项目README美化 | Github徽章制作
    Github项目README美化|Github徽章制作1、前言平时逛Github开源项目的时候,经常看到README文件会有各式各样的小徽章,哈哈,你是不是也想在自己的项目上添加Github小徽章。让我们来看看别人的项目徽章。VueReact无疑,这样的Github徽章能合理的优化README的美化,能够更加地吸引别......
  • Maven打包项目时异常:Cannot access nexus-aliyun (http://maven.aliyun.com/nexus/con
    package是报错Cannotaccessnexus-aliyun(http://maven.aliyun.com/nexus/content/groups/public)inofflinemodeandtheartifactorg.apache.maven.surefire:maven-surefire-common:pom:2.22.2hasnotbeendownloadedfromitbefore.根据翻译的意思:无法在脱机模式下......
  • ALSA Compress-Offload API
    概述从ALSAAPI的早期开始,它就被定义为支持PCM,或考虑到了IEC61937等固定比特率的载荷。参数和返回值以帧计算是常态,这使得扩展已有的API以支持压缩数据流充满挑战。最近这些年,音频数字信号处理器(DSP)常常被集成进片上系统(SoC)设计中,且DSPs也常被集成进音频编解码......
  • CompletableFuture 学习
    创建异步任务CompletableFuture创建异步任务,一般有supplyAsync和runAsync两个方法supplyAsync执行CompletableFuture任务,没有返回值//使用默认内置线程池ForkJoinPool.commonPool(),根据supplier构建执行任务publicstatic<U>CompletableFuture<U>supplyAsync(Suppli......
  • Kattis - A Complex Problem (The 2023 ICPC Rocky Mountain Regional Contest)
    IntroThiswasoneoftheproblemsIdidn'tdoduringtheregionalcontest.Oneofmyteammatessolvedit.ObservationTherearefewthingstonote.Firsttypeofnotation:subsetmeansthatA$\subset$B,buttherecanbecasesthatsubsetforms......
  • C++ insert into tables of pgsql via libpq-fe.h and compile by g++-13
    1.Installlibpq-devsudoaptinstalllibpq-devlocatelibpq-fe.h/usr/include/postgresql/libpq-fe.h 2.createtablet1createtablet1(idbigserialnotnullprimarykey,authorvarchar(40)notnull,commentvarchar(40)notnull,contentvarchar(40)notn......