赞
踩
git拉取/推送github代码出现Connection closed by问题,这个问题出现过几次,还是总结一下
使用git去拉取github代码的时候,出现了如下问题
Connection closed by ip port
致命错误:无法读取远程仓库。
请确认您有正确的访问权限并且仓库存在。
或
Connection closed by ip port
fatal : Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
访问 GitHub 可能会受到防火墙(Great Firewall)的限制,导致无法正常读取代码。这可能是导致在拉取 GitHub 代码时遇到问题的原因之一,当然也最有可能的就是这个情况了。
切换梯子的节点解决
通过配置使git走https协议解决
主要是修改 ~/.ssh/config 文件
检查 cat ~/.ssh/config
文件当前配置
编辑 vim ~/.ssh/config
增加配置如下
Host github.com
Hostname ssh.github.com
Port 443
User git
即
ssh -T git@github.com
ssh -T git@github.com
出现下图情况,选择yes即可
出现如下即可
Warning: Permanently added '[ssh.github.com]:443' (ED25519) to the list of known hosts.
Hi **! You've successfully authenticated, but GitHub does not provide shell access.
参考:kex_exchange_identification: Connection closed by remote host
我是通过方法一配合方法二解决搞定的,但也时常因为
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。