现象
尝试克隆 Github 仓库时遇到了的报措
kex_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
检查了各项配置:
$ ssh -T git@github.com
kex_exchange_identification: Connection closed by remote host
原因
家中使用的网络代理封禁了 Github 端口 22 的连接
解决
将 Github 的连接端口从 22 改为 443 即可。修改 ~/.ssh/config ,添加如下段落即可
Host github.com
HostName ssh.github.com
User git
Port 443
验证
$ ssh -T git@github.com
Hi xxx! You've successfully authenticated, but GitHub does not provide shell access.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)