Idle SSH connection gets reset in ubuntu 20.04 WSL (Windows10)

Solution 1:

You shall look on these parameters on the client side /etc/ssh/ssh_config
ServerAliveInterval
ServerAliveCountMax

Maybe you can try set and elaborate from there about the timeout.
ServerAliveInterval 60

Reference Ubuntu ssh_config

Solution 2:

Had a similar issue with a slightly different setup: SSH from Windows Terminal (PowerShell) to an Ubuntu Server which is a VirtualBox virtual machine. If I left the connection running overnight, I was greeted in the morning with:

client_loop: send disconnect: Connection reset

There wasn't a by peer in that line by the way, just the above. I fixed it by changing the server config only. At the Ubuntu shell:

$ sudo vim /etc/ssh/sshd_config
# Added the following:
ClientAliveInterval 60
ClientAliveCountMax 5

These values can be tweaked of course, but now the connection stays even after the computer goes to sleep or standby.