通过git将代码push到github仓库出现错误

错误:

kex_exchange_identification: Connection closed by remote host
Connection closed by 198.18.0.11 port 22
fatal: 无法读取远程仓库。

解决

网上查阅资料,有人说是因为挂了VPN导致的,禁止了github的ssh连接,我尝试关掉VPN没有解决问题。
具体解决方法:修改~/.ssh/config

vim ~/.ssh/config

// 加入以下内容
Host github.com
  HostName ssh.github.com
  User git
  Port 443

posted @ 2022-09-23 23:19  sqw666  阅读(176)  评论(0编辑  收藏  举报