!["ssh_exchange_identification: 읽기: 피어에 의한 연결 재설정" 오류를 수정하는 방법은 무엇입니까?](https://rvso.com/image/1000397/%22ssh_exchange_identification%3A%20%EC%9D%BD%EA%B8%B0%3A%20%ED%94%BC%EC%96%B4%EC%97%90%20%EC%9D%98%ED%95%9C%20%EC%97%B0%EA%B2%B0%20%EC%9E%AC%EC%84%A4%EC%A0%95%22%20%EC%98%A4%EB%A5%98%EB%A5%BC%20%EC%88%98%EC%A0%95%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%80%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
내 컴퓨터를 사용하여 SSH를 통해 내 서버에 연결할 수 없지만 termius 앱을 사용하여 휴대폰을 통해 이 서버에 연결할 수 있습니다. 나는 iptables를 /etc/hosts.allow
확인 했고 /etc/hosts.deny
Google에서도 검색했는데 이 문제에 맞는 답변이 없는 것 같습니다. 해결 방법을 모르겠습니다. 여기에 ssh -v 183.17.228.80
출력이 있습니다.
debug1: Connecting to 183.17.228.80 [183.17.228.80] port 22.
debug1: Connection established.=======================
debug1: permanently_set_uid: 0/0
debug1: SELinux support disabled
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
ssh_exchange_identification: read: Connection reset by peer
이 서버에 핑을 보낼 수 있습니다. 여기는 텔넷입니다.
telnet 183.17.228.29 22
Trying 183.17.228.29...
Connected to 183.17.228.29.
Escape character is '^]'.
Connection closed by foreign host.
답변1
단지서버를 재부팅하세요당신이 ssh하려는 것. 이전에는 동일한 문제에 직면했지만 그것은 나를 위해 일했습니다.
답변2
이는 실제로 귀하의 IP가 서버에 의해 블랙리스트에 등록되었음을 의미합니다. 로그인할 수 있도록 IP 주소를 화이트리스트에 등록해 보세요. 서버의 IP 주소가 변경되었는지 확인하려면 /etc/hosts 목록을 살펴보세요.
답변3
동일한 문제가 있었지만 sshd 데몬을 다시 시작한 후 호스트에 연결할 수 있었습니다.
sudo systemctl restart sshd && systemctl status sshd
이는 MaxAuthTries 매개변수를 늘릴 때까지 임시 해결 방법일 뿐입니다.
답변4
서버의 SSH 데몬이 중단된 것 같습니다. 실행되고 있는 것이 확실합니까? ssh에 텔넷으로 접속할 때 서명을 확인해야 합니다. 다음과 같은 것 :
telnet unixhow.com 22
Trying 35.228.26.20...
Connected to unixhow.com.
Escape character is '^]'.
SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.1
귀하의 출력에서 ssh 데몬이 서버 측에서 응답하지 않는 것을 볼 수 있습니다. IP-KVM(또는 다른 방법)을 통해 원격 시스템에 연결하고 sshd를 다시 시작하는 것이 좋습니다.