我已经通过Mac连接到远程服务器大约一个月了。不过,从最近开始,我尝试使用ssh dylan @ MY_IP进行连接并收到此消息。
ssh_exchange_identification: read: Connection reset by peer
我也得到了一些诊断信息...
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 53: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to {MY IP{ [MY IP] port 22.
debug1: Connection established.
debug1: identity file /Users/watson/.ssh/id_rsa type -1
debug1: identity file /Users/watson/.ssh/id_rsa-cert type -1
debug3: Incorrect RSA1 identifier
debug3: Could not load "/Users/watson/.ssh/id_dsa" as a RSA1 public key
debug1: identity file /Users/watson/.ssh/id_dsa type 2
debug1: identity file /Users/watson/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
经过研究,我尝试了以下方法...
- 重新启动我的路由器
- 清除了我的“ known_hosts”文件
- 删除了我的“ known_hosts”文件
- 发布并续订了我的DHCP
- 我也尝试过使用Putty在另一个设备(Windows)上也出现错误
请注意,我没有对服务器进行任何更改以禁止这种通信。
另外,我不确定这是否会引起问题,但是我已经通过它的域名和IP连接到它了。
此外,我还能够从另一个IP地址成功连接。
我知道这是一个大问题,有很多资源可供使用,但是许多解决方案都行不通,我也没有为任何人看到任何类型的解决方案。
更新资料
我将其强制为协议1。现在,我收到的不是“由对等方重置连接”,而是“由远程主机关闭了连接”。显示调试信息并运行它:
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 53: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to MY_IP [MY_IP] port 22.
debug1: Connection established.
debug1: identity file /Users/watson/.ssh/identity type -1
debug1: identity file /Users/watson/.ssh/identity-cert type -1
ssh_exchange_identification: Connection closed by remote host
ssh -1 ...
/Users/watson/.ssh/id_dsa吗?尝试备份文件并将其删除。