title: Unable to git fetch - Connection reset by peer
body: <p>I have a PHP script handling the automatic deploy to my pre-production server, using <a href="https://confluence.atlassian.com/display/BITBUCKET/Manage+Bitbucket+hooks" rel="nofollow">Bitbucket's hooks</a>. The deploy script is <a href="http://jonathannicol.com/blog/2013/11/19/automated-git-deployments-from-bitbucket/" rel="nofollow">based on this post</a>.</p>
  
  <p>Everything was working fine until this Sunday. Since then, the automatic deploy stopped working. If I <code>cd</code> into my git repository from the preprod server and do a manual <code>git fetch</code>, I get the generic and unexpressive:</p>
  
  <pre><code>Read from socket failed: Connection reset by peer
  fatal: The remote end hung up unexpectedly
  </code></pre>
  
  <p>I made sure my ssh <code>id_rsa</code> key is well copied to BitBucket. It would have been very surprising overwise, as I hadn't touched it since the script has been operating.</p>
  
  <p>Here are the different permissions assigned : </p>
  
  <pre><code>$ ls -al ~ | grep .ssh                                      
  drwx------  2 local local     4096 mars  13 13:28 .ssh  
  
  $ ls -al ~/.ssh                                                                             
  -rw-r--r--  1 local local  802 mars  11 17:11 authorized_keys                                            
  -rw-r--r--  1 local local   51 mars  11 18:16 config
  -rw-------  1 local local 1675 mars  12 17:44 id_rsa
  -rw-r--r--  1 local local  396 mars  12 17:44 id_rsa.pub                                           
  -rw-------  1 local local 1326 mars  25 17:38 known_hosts   
  -rw-r--r--  1 local local 1326 mars  11 18:34 known_hosts.old
  </code></pre>
  
  <p>So as I can't <code>git fetch</code> my remote repository, so does my server, and the (automatic) deploy just can't happen. I can't find why SSH is refusing to work. I tried with several keys and users the all afternoon. </p>
  
  <p>Any suggestion is most welcome.</p>