SSH problem - Read from socket failed: Connection reset by peer

  1. start monitoring the server's log file

    tail -f /var/log/auth.log

  2. add -v to get a verbose output at the client end

    ssh user@computerB -v

This might give you more details about the cause. if the rsa and dsa keys are missing on the server, fix them by:

ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t dsa  -f /etc/ssh/ssh_host_dsa_key

I re-installed the SSH bits by doing:

sudo apt-get --reinstall install openssh-server openssh-client

This fixed all my problems.


änthräX's method is very helpful. It works for me!

Basically I think, after installed ssh, key files are needed.

The only revision I made was to use rsa instead of rsa1:

ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key 
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key

That modified method worked for me.

Tags:

Ssh