If you can’t connect to your Raspberry Pi by SSH, with an error like:
Connection reset by xxx.xxx.xxx.xxx port xx
In my case it is because the IP was already used in the past by another Raspberry Pi.
You need to remove the current SSH host(s):
sudo rm /etc/ssh/ssh_host_*
Then reconfigure your Raspberry Pi SSH server:
sudo dpkg-reconfigure openssh-server
Now you access again the Raspberry Pi as a new SSH connection.
NB: Those commands to be done on the Raspberry Pi, not the SSH client.