【问题标题】:Unable to do SSH to remote Server. Error : ssh_exchange_identification: read: Connection reset by peer无法对远程服务器进行 SSH。错误:ssh_exchange_identification:读取:对等方重置连接
【发布时间】:2018-11-10 01:54:06
【问题描述】:
I have changed the file sshd_config under /etc/ssh/ directory. I have also changed the permission of files under /etc/ssh/ directory. Now when i am trying to execute

ssh username@remoteserverIP -vv 
I am getting below logs.

OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving "server IP" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to server IP [server IP] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/username/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/username/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/username/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/username/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/username/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/username/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/username/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/username/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
ssh_exchange_identification: read: Connection reset by peer

我无权访问 root 用户。我也试过通过腻子。腻子给出以下错误。

服务器意外关闭网络连接

【问题讨论】:

  • 这和java有什么关系?
  • 我删除了标签 JAVA
  • Stackoverflow 用于软件开发方面的帮助。您应该考虑在Unix & LinuxServer FaultSuper User 上而不是在这里提出这样的问题。此外,“ssh_exchange_identification: read: Connection reset by peer”是一个很常见的错误消息。您应该能够搜索它并找到其他问题。

标签: linux ssh centos


【解决方案1】:

也许/etc/hosts.deny 包含一个“ALL:”或“ssh:”条目阻止您连接。

将“ssh: ALL”或“ssh: x.x.x.x”(将 x.x.x.x 替换为您的 IP)添加到 /etc/hosts.allow 可以解决此问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-15
    • 1970-01-01
    相关资源
    最近更新 更多