I have a brand new Raspberry Pi 4B running a fresh install of Raspberry Pi OS full. My intent is to use it primarily over ssh. I'm not currently using wifi for this, just an ethernet connection directly from the pi to my laptop (Windows 10 machine) with nothing in between.
I'm able to initiate an ssh connection just fine (using OpenSSH from Windows terminal). However, after I've been connected for several minutes, the pi will disconnect and I get client_loop: send disconnect: Connection reset
. This doesn't only happen when connection has been idle; it often happens while I'm running commands. It's typically about 1-4 minutes after I first connect. Once I've been disconnected, I can't connect again until I uplug the ethernet cable and plug it in again. I've verified that the pi is not rebooting when this happens.
Here's what I've tried:
- Several different power supplies for the pi (with plenty of wattage)
- Reinstalling Pi OS
- Connecting from a different windows machine
- Adding
TCPKeepAlive yes
to /etc/ssh/sshd_config - Adding
ClientAliveInterval 60
andClientAliveCountMax 5
to /etc/ssh/sshd_config - Adding
IPQoS cs0 cs0
to /etc/ssh/sshd_config as suggested by a lot of people, even though none of them seem to have any idea what it means.
Note that I restarted sshd after each edit to the config file.
For anyone interested, here are the ssh logs on triple verbose for a single login. Unfortunately, there are no logs at the time of the disconnection, the logfile skips straight to the time of the next login.
EDIT: After further testing, it looks like the pi ALWAYS disconnects 185 seconds after I connect the ethernet cable, independent of when I log in over ssh. The 185 number is very consistent. So, maybe not an ssh issue? Maybe hardware or firmware?