linux - 无法通过 SSH 连接到远程服务器。错误: ssh_exchange_identification: read: Connection reset by peer

标签 linux ssh centos

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 用户。我也通过腻子尝试过。 Putty 给出以下错误。

服务器意外关闭网络连接

最佳答案

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

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

关于linux - 无法通过 SSH 连接到远程服务器。错误: ssh_exchange_identification: read: Connection reset by peer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50617733/

相关文章:

linux - 如何验证字符串是否为字母数字组合(包含字母和数字)#linux #Bash

docker - 建立从 Jenkins 容器到 SSH 服务器容器的 SSH 连接,我可以用密码登录建立但不能用私钥建立

security - 限制用户在 (HA) 代理上的 SSH 访问

php - 权限在 PHP 中被拒绝

regex - 从除文件扩展名 (.png) 之外的所有文件中删除 _ 之后出现的字符

java - 从 Java 程序运行 grep

c++ - 在 Linux 中构建 C++11 线程翻译单元

bash - 如何减少ssh连接超时值

linux - Yum 更新与 Perl 包有问题

Apache - 无法启用 TLS 1.0 或 TLS 1.1