$ git push origin master
ssh_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服务试试
sudo /etc/init.d/ssh restart
或者
sudo service sshd restart
其他方法可以试试下面链接
还可以使用http替代ssh试试
$ git push origin master
ssh_exchange_identification: read: Connection reset by peer
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
这个错误一般是由ssh出错导致 切换为https地址的即可
1、从ssh切换至https
git remote set-url origin(远程仓库名称) https://email/username/ProjectName.git
比如:git remote set-url origin master https://email/username/ProjectName.git
2、从https切换至ssh
git remote set-url origin git@email:username/ProjectName.git
3、查看当前是ssh还是https
git remote -v
如切换后出现 remote: HTTP Basic: Access denied
git执行以下命令输入 git账号密码即可
git config --system --unset credential.helper
参考自以下链接
————————————————
版权声明:本文为CSDN博主「高先生的猫」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/z591102/article/details/104696625/
作者:知乎用户
链接:https://www.zhihu.com/question/20023544/answer/90125294
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
ssh 报错“ssh_exchange_identification: Connection closed by remote host”_记录点滴-CSDN博客