kex_exchange_identification: read: Connection reset by peer
When connecting to Ubuntu 20.04 server using SSH from a Mac computer, get an error
kex_exchange_identification: read: Connection reset by peer
On checking the servers log file (/var/log/auth.log), found the following error message
Jul 23 06:53:34 server sshd[24147]: Unable to negotiate with 17.19.44.24 port 47280: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1 [preauth]
To fix this, on the server, edit sshd_config
vi /etc/ssh/sshd_config
At end of the file, add
KexAlgorithms +diffie-hellman-group1-sha1
Restart ssh
systemctl restart ssh
See SSH