github clone失败问题解决
github clone失败问题解决,报错信息如下kex_exchange_identification: Connection closed by remote host Connection closed by UNKNOWN port 65535fatal: Could not read from remote repository.
·
问题描述
- git 克隆 github 仓库,表现如下
$ git clone git@github.com:CANopenNode/CANopenNode.git
Cloning into 'CANopenNode'...
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.
- 参考github上的一个帖子,配置ssh的系统代理如下
github上解决该问题的帖子
win11配置:在.ssh目录下新建文件config, .ssh/config 内容如下:
Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 22
ProxyCommand connect -S 127.0.0.1:7890 %h %p
- 重新克隆第一步的仓库,继续报错
$ git clone git@github.com:CANopenNode/CANopenNode.git
Cloning into 'CANopenNode'...
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
- 继续搜索该问题,发现另一篇解决问题的帖子
原贴
修改 .ssh/config的内容如下
Host github.com
User git
Port 443
Hostname ssh.github.com
IdentityFile ~/.ssh/id_rsa
TCPKeepAlive yes
ProxyCommand connect.exe -S 127.0.0.1:7890 -a none %h %p
Host ssh.github.com
User git
Port 443
Hostname ssh.github.com
IdentityFile ~/.ssh/id_rsa
TCPKeepAlive yes
ProxyCommand connect.exe -S 127.0.0.1:7890 -a none %h %p
- 重新克隆,问题得到解决,github仓库可以正常克隆,但是无法Ping github的问题仍未解决
问题分析
- 猜想可能是因为代理配置的问题导致和github的通信出现错误,原因不清楚
- 在终端ping github的时候发现解析出来的地址是20.205.243.166,使用Ip查询网站发现该ip在香港,猜想可能是因为DNS解析的问题导致解析出来的github地址无法访问,不过这个问题不重要,github能够克隆就行
更多推荐
所有评论(0)