-1

Just copied over a fresh image of raspbian buster lite with an additional ssh file in the boot partition.

When trying ssh though I'm running into troubles:

ssh raspberrypi
The authenticity of host 'raspberrypi (***)' can't be established.
ECDSA key fingerprint is SHA256:Tbh4r0cgCBP2L7Gtu93Q+ql90rwSwQZXw//gER/w+Qw.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'raspberrypi,***' (ECDSA) to the list of known hosts.
daniel@raspberrypi's password: 

 ~  ssh pi@raspberrypi
pi@raspberrypi's password: 
Connection to raspberrypi closed by remote host.
Connection to raspberrypi closed.
 ~  ssh pi@raspberrypi
kex_exchange_identification: read: Connection reset by peer

Verbose mode is not much more helpful either:

OpenSSH_8.2p1, OpenSSL 1.1.1g  21 Apr 2020
debug1: Reading configuration data /home/daniel/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "raspberrypi" port 22
debug2: ssh_connect_direct
debug1: Connecting to raspberrypi [fd0e:94f0:31df::abd] port 22.
debug1: Connection established.
debug1: identity file /home/daniel/.ssh/id_rsa type 0
debug1: identity file /home/daniel/.ssh/id_rsa-cert type -1
debug1: identity file /home/daniel/.ssh/id_dsa type -1
debug1: identity file /home/daniel/.ssh/id_dsa-cert type -1
debug1: identity file /home/daniel/.ssh/id_ecdsa type -1
debug1: identity file /home/daniel/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/daniel/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/daniel/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/daniel/.ssh/id_ed25519 type -1
debug1: identity file /home/daniel/.ssh/id_ed25519-cert type -1
debug1: identity file /home/daniel/.ssh/id_ed25519_sk type -1
debug1: identity file /home/daniel/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/daniel/.ssh/id_xmss type -1
debug1: identity file /home/daniel/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2
kex_exchange_identification: read: Connection reset by peer

Whats going wrong here?

2
  • daniel@raspberrypi will never work unless you create a user by that name. Apr 25 '20 at 17:43
  • Thanks, for your input, but as you can see from the logs, it's just what I accidentally did on the first run. Also, it doesn't explain the error
    – dba
    Apr 26 '20 at 14:12
3

I cleared a kex_exchange_identification: read: Connection reset by peer error i was getting trying to ssh into a pi by rebooting my client - turns out it was my workstation with the issue not the pi. Hope this helps someone who found themselves on this thread for the same reason.

1
  • woohoo! this was my problem. thanks Feb 7 at 2:02
2

After facing lots of additional weird problems it turned out, that the micro sd card was just damaged. After trying a new one, everything seems to work as expected.

1
  • 1
    Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year.
    – Ingo
    Apr 30 '20 at 7:31
1

I would look at the end of /var/log/auth.log on the raspberrypi to see if there are any clues as to why sshd is disconnecting.

"Connection reset by peer" is often a symptom of IP address conflict -- multiple hosts trying to use the same IP address. Doesn't seem like that's the case here, but it's easy enough to check: run the arp command repeatedly and see if the MAC address for the raspberrypi is ever wrong.

Or just reboot the raspberrypi? That'll restart sshd, which may clear any problems it might be experiencing. Plus it will force the raspberrypi to re-request its DHCP lease which is an opportunity to detect and fix any IP address conflict (assuming you're using DHCP, of course).

0

My problem was missing directory /run/sshd

sudo mkdir /run/sshd
2
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. You can also add a bounty to draw more attention to this question. - From Review
    – Milliways
    Jul 13 at 4:45
  • 2
    /run/sshd is created automatically when you install SSH, so it's unlikely this post will help anyone. Jul 13 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.