yzaq
Posts: 1
Joined: Sun Mar 04, 2018 5:06 pm

Connection reset when login to ssh

Sun Mar 04, 2018 5:17 pm

Hello, I have a raspberry pi 3 headless. In the boot partition i created the ssh file, so when it boots it starts the ssh server. When I try to login, the raspi resets the connection. I paste the verbose of ssh when I try to connect from my computer:

$ ssh -vvv pi@10.0.0.69
OpenSSH_7.6p1, OpenSSL 1.1.0g 2 Nov 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "10.0.0.69" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 10.0.0.69 [10.0.0.69] port 22.
debug1: Connection established.
debug1: identity file /home/yzaq/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /home/yzaq/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/yzaq/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/yzaq/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/yzaq/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/yzaq/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/yzaq/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/yzaq/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4p1 Raspbian-10+deb9u1
debug1: match: OpenSSH_7.4p1 Raspbian-10+deb9u1 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 10.0.0.69:22 as 'pi'
debug3: hostkeys_foreach: reading file "/home/yzaq/.ssh/known_hosts"
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
Connection reset by 10.0.0.69 port 22


What is the problem? Thanks!

bafu
Posts: 1
Joined: Thu Apr 26, 2018 12:11 pm

Re: Connection reset when login to ssh

Thu Apr 26, 2018 12:21 pm

I also met this issue in 2018-04-18-raspbian-stretch-lite.img. If you executed the command below and see the error messages:

Code: Select all

rpi $ sudo service ssh status
...
Apr 26 12:04:24 raspberrypi sshd[575]: error: key_load_public: invalid format
Apr 26 12:04:24 raspberrypi sshd[575]: error: Could not load host key: /etc/ssh/
...
You can try the following steps[1] which work for me:

Code: Select all

rpi $ sudo rm /etc/ssh/ssh_host_*
rpi $ sudo dpkg-reconfigure openssh-server

Return to “Troubleshooting”