2

git | kex_exchange_identification

 7 months ago
source link: https://benpaodewoniu.github.io/2024/01/17/git11/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

git | kex_exchange_identification

2024-01-17git

6 0

上传 GitHub 出错。

一直都是好好的,结果,突然之间上传代码出错,报错信息如下。

kex_exchange_identification: Connection closed by remote host
Connection closed by 127.0.0.1 port 1081
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

提示连不上 github 的服务器,我做了下面的工作。

  • github 重新更换 ssh key
  • 查询 127.0.0.1 1081 是什么程序占用,并 kill
  • 增加 proxy ,让上传走 vpn

都不行。但是,不知道怎么得,试着试着,报错信息变成了

ssh: connect to host github.com port 22: Operation timed out
fatal: Could not read from remote repository.

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

然后又进行了下面的操作。

  • 增加 Port 443
  • 去除 proxy

一系列操作,都无果。

并对 git config --local -egit config --global -e 做了很多魔改操作,都不行。

然后灵光一闪,想到了 ~/.ssh/config

我原本的内容是

# hexo
Host licong.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/licong
# hexo
Host licong.com
HostName ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/licong

当然别人说增加 Port 443 也有奇效。

请我喝杯咖啡吧~

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK