title: Occasionally encounter error “ssh_exchange_identification: read: Connection reset by peer”
body: <p>I have posted this question on Serverfault (<a href="https://serverfault.com/questions/701920/occasionally-encounter-error-ssh-exchange-identification-read-connection-rese">https://serverfault.com/questions/701920/occasionally-encounter-error-ssh-exchange-identification-read-connection-rese</a>), but get no answers. Hence I repost this question here, hoping to get more exposure to experts. </p>
  
  <p>When I try to connect a remote Linux server using ssh, sometimes I got the error <code>ssh_exchange_identification: read: Connection reset by peer</code> while other times I can connect to the server successfully. This error also occurs while I have another successful ssh connection already open and can run command on the server.</p>
  
  <p>On the server side (a Ubuntu machine), I found no record of the failed connection in either <em>/var/log/syslog</em>, or <em>auth.log</em>.</p>
  
  <p>On my local machine, <code>ssh IP -vv</code> gives the following information which does not seem help either, </p>
  
  <pre><code>OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
  debug1: Reading configuration data /etc/ssh/ssh_config
  debug1: Applying options for *
  debug2: ssh_connect: needpriv 0
  debug1: Connecting to IP [IP] port 22.
  debug1: Connection established.
  debug1: identity file /home/luke/.ssh/identity type -1
  debug1: identity file /home/luke/.ssh/identity-cert type -1
  debug2: key_type_from_name: unknown key type '-----BEGIN'
  debug2: key_type_from_name: unknown key type '-----END'
  debug1: identity file /home/luke/.ssh/id_rsa type -1
  debug1: identity file /home/luke/.ssh/id_rsa-cert type -1
  debug1: identity file /home/luke/.ssh/id_dsa type -1
  debug1: identity file /home/luke/.ssh/id_dsa-cert type -1
  debug1: identity file /home/luke/.ssh/id_ecdsa type -1
  debug1: identity file /home/luke/.ssh/id_ecdsa-cert type -1
  ssh_exchange_identification: read: Connection reset by peer
  </code></pre>
  
  <p>Any idea how to debug this error? It actually happens rather frequently, but the difficult part is that it does not always happen. I also tried to install exact same version of openSSH and install same Ubuntu version in VirtualBox and connect from there, none of these helps.</p>