提交文件到github远程仓库
git push origin master
kex_exchange_identification: Connection closed by remote host
Connection closed by 20.205.243.166 port 22
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
文件成功提交到远程仓库
分步骤:
1.先在本地命令行或者ide中用git clone 命令下载一下代码。看看是否可以。如果可以,那就是没有push权限
第一步,先去查了一下是不是SSH的私钥过期了, 但查了一下并没有问题。这时候你按照网上的教程:删除SSH公钥,然后重新生成的公钥,配置到GitHub,应该都是不好使的。
第二步,思考了一下近期的操作,使用新的梯子,设置了TUN模式代理了全局, 有可能造成了端口变化, 导致了git基于SSH拉取出了问题。
第三步,查了一下关于关于git端口设置的相关问题, 参考了几个技术问答的答案, 最后解决的方式就很简单了。直接配置SSH访问的端口号就好。