I suddenly can't connect to my Raspberry Pi from my laptop. In Terminal, I try to access with the command ssh pi@192.168.XX.XXX
and I get this message:
ssh_exchange_identification: read: Connection reset by peer
I have searched for answers but nothing works:
sudo rm /etc/ssh/ssh_host_*
didn't result in anything..sudo dpkg-reconfigure openssh-server
gave:sudo: dpkg-reconfigure: command not found
ssh -vv pi@192.168.XX.XXX
gave:OpenSSH_7.9p1, LibreSSL 2.7.3 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 48: Applying options for * debug2: resolve_canonicalize: hostname 192.168.XX.XXX is address debug2: ssh_connect_direct debug1: Connecting to 192.168.XX.XXX [192.168.XX.XXX] port 22. debug1: Connection established. debug1: identity file /Users/peterwesterlund/.ssh/id_rsa type -1 debug1: identity file /Users/peterwesterlund/.ssh/id_rsa-cert type -1 debug1: identity file /Users/peterwesterlund/.ssh/id_dsa type -1 debug1: identity file /Users/peterwesterlund/.ssh/id_dsa-cert type -1 debug1: identity file /Users/peterwesterlund/.ssh/id_ecdsa type -1 debug1: identity file /Users/peterwesterlund/.ssh/id_ecdsa-cert type -1 debug1: identity file /Users/peterwesterlund/.ssh/id_ed25519 type -1 debug1: identity file /Users/peterwesterlund/.ssh/id_ed25519-cert type -1 debug1: identity file /Users/peterwesterlund/.ssh/id_xmss type -1 debug1: identity file /Users/peterwesterlund/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_7.9 ssh_exchange_identification: read: Connection reset by peer
sudo rm /etc/ssh/ssh_host_*
gave:rm: /etc/ssh/ssh_host_*: No such file or directory
lsof -n | grep ssh | grep DEL
didn't do anything
I'm not very good or comfortable with command lines. So I don't really know what things above mean but I found those things when I searched for solutions online.
Edit:
On request, here is the list of devices connected to my network and you see my Raspberry Pi/Hassbian there:
ssh pi@hassbian
get the same message. I'm on a Macbook Air, so yes Mac. I don't understand what you are saying that I could do. I'm not familiar with that file, I'm not that comfortable with command lines. What command should I run? – Peter Westerlund Apr 13 '20 at 22:17nano .ssh/known_hosts
and see if the list has an entry for the name or IP address. If so use the cursor key to move to the line and press ctrl-k (not cmd key). Repeat as needed and then press ctrl-x and save the file as the same name if you deleted any line. Then try again. – Apr 13 '20 at 23:12