ssh_exchange_identification: read: Connection reset by peer

13 篇文章 1 订阅

问题:使用MobaXterm 登录服务器,提示ssh_exchange_identification: read: Connection reset by peer

[lanxum.LAPTOP-OMIO6B77] ➤ ssh root@10.10.2.230
ssh_exchange_identification: read: Connection reset by peer

解决:

使用ssh -v查看详细登录过程。

[lanxum.LAPTOP-OMIO6B77] ➤ ssh -v -T 10.10.2.230
OpenSSH_7.5p1, OpenSSL 1.0.2o  27 Mar 2018
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 13: Deprecated option "useroaming"
debug2: resolving "10.10.2.230" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 10.10.2.230 [10.10.2.230] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.5
ssh_exchange_identification: read: Connection reset by peer

通过搜索分析可以发现,很多这样的问题,原因也是五花八门,主要都是集中在一下几个方面:

1、网络问题,ip被加入到限制列表。

2、目录文件夹权限有问题。

等等还有其他未发现的原因。

解决方法也是很多,主要就是一下几种。

1、如果是IP被限制问题,可以直接联系网管了。

        如果自己手动修改的话,可以直接修改 /etc/hosts.allow,追加sshd: ALL(允许所有ip主机均能连接本机)或根据需要进行授权,然后重启service sshd restart即可具体参考相关规则,当然这有个前提你能进入主机内。网上帖子N多,不再赘述。

2、/var 目录权限过大,导致ssh失败。

        修改该目录权限为755。具体参考博客由chmod改系统文件权限引ssh登录报ssh_exchange_identification: read: Connection reset by peer无法登陆问题

3、其他

        我还发现一个也是该问题的分析,特此留作参考:

SSH to AWS EC2 issue - key_load_public: No such file or directory [closed]

        我也碰到了同样的问题,上面各种解决方案我也曾一一试过,但是依然不起作用。造成这个问题的原因是什么,至今未能查找出来。只能留一个记录,等待以后再碰到此问题,再补充原因和解决方法了。

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值