Sample Header Ad - 728x90

SSH error kex_exchange_identification: read: Connection reset by peer

1 vote
0 answers
2440 views
I'm having a problem when I SSH into WSL2 from a Raspberry Pi. I've created rules on my Windows machine to forward port 2222 to WSL2 and set up an inbound firewall rule to allow traffic on port 2222. This is the SSH debug output when I run this command: ssh riccardoob@[windows ip] -p 2222 -vvv OpenSSH_8.4p1 Ubuntu-5ubuntu1.1, OpenSSL 1.1.1j 16 Feb 2021 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files debug1: /etc/ssh/ssh_config line 21: Applying options for * debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/ubuntu/.ssh/known_hosts' debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/ubuntu/.ssh/known_hosts2' debug2: resolving "[domain name]" port 2222 debug2: ssh_connect_direct debug1: Connecting to [domain name] [ip] port 2222. debug1: Connection established. debug1: identity file /home/ubuntu/.ssh/id_rsa type -1 debug1: identity file /home/ubuntu/.ssh/id_rsa-cert type -1 debug1: identity file /home/ubuntu/.ssh/id_dsa type -1 debug1: identity file /home/ubuntu/.ssh/id_dsa-cert type -1 debug1: identity file /home/ubuntu/.ssh/id_ecdsa type -1 debug1: identity file /home/ubuntu/.ssh/id_ecdsa-cert type -1 debug1: identity file /home/ubuntu/.ssh/id_ecdsa_sk type -1 debug1: identity file /home/ubuntu/.ssh/id_ecdsa_sk-cert type -1 debug1: identity file /home/ubuntu/.ssh/id_ed25519 type -1 debug1: identity file /home/ubuntu/.ssh/id_ed25519-cert type -1 debug1: identity file /home/ubuntu/.ssh/id_ed25519_sk type -1 debug1: identity file /home/ubuntu/.ssh/id_ed25519_sk-cert type -1 debug1: identity file /home/ubuntu/.ssh/id_xmss type -1 debug1: identity file /home/ubuntu/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.4p1 Ubuntu-5ubuntu1.1 kex_exchange_identification: read: Connection reset by peer Connection reset by [ip] port 2222 What is throwing me off is the fact that the connection is correctly established and the server is correctly set up. I have to specify that I was able to ssh into wsl from the same raspberry but all of a sudden this error starts to show up, unfortunately I can't say for certain what I did since the last successfull connection. Please ask if more informations are necessary to best debug this issue. EDIT: I tried from outside the network wsl is connected to, as suggested by a thread that I found here but I get a similar error: ssh_exchange_error: connection closed by peer
Asked by Riccardo Barbieri (23 rep)
Oct 6, 2021, 06:39 PM
Last activity: Apr 3, 2025, 10:01 AM