git 错误 ssh_exchange_identification: Connection closed by remote hostfatal Connection reset by peer

15 篇文章 1 订阅
11 篇文章 0 订阅

$ 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博客

https://blog.csdn.net/km_moon/article/details/84775092

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值