git 拉取推送代码报错

问题

今天 git pull 的时候遇到 kex_exchange_identification: Connection closed by remote host Connection closed by 54.151.144.214 port 22

解决

网上搜索,说是 22 端口被封了。

`vim ~/.ssh/config` 改成下面的配置:

Host *
  ServerAliveInterval 30
  AddKeysToAgent yes
  UseKeychain yes

# Default
Host github.com
  HostName ssh.github.com
  User git
  Port 443
  IdentityFile ~/.ssh/id_rsa

以前的配置是这样:

Host *
  ServerAliveInterval 30
  AddKeysToAgent yes
  UseKeychain yes

# Default
Host github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa

链接

如果觉得我的文章对您有用,请在支付宝公益平台找个项目捐点钱。 @Victor Jul 16, 2022

奉献爱心