title: Capistrano cannot deploy code, because Net::SSH::AuthenticationFailed: Authentication failed
body: <p>We have a Rails app that is running on Amazon AWS. We're pushing there a new code almost every day for a few months in a row.</p>
  
  <p>Today, when I tried to deploy a new code there, I was given this error message:</p>
  
  <pre><code>  * 2014-02-16 13:09:51 executing `deploy'
    * 2014-02-16 13:09:51 executing `deploy:update'
   ** transaction: start
    * 2014-02-16 13:09:51 executing `deploy:update_code'
      updating the cached checkout on all servers
      executing locally: "git ls-remote git@bitbucket.org:my_bitbucket_name/project_name.git master"
      command finished in 2909ms
    * executing "if [ -d /home/deployer/project_name/shared/cached-copy ]; then cd /home/deployer/project_name/shared/cached-copy &amp;&amp; git fetch -q origin &amp;&amp; git fetch --tags -q origin &amp;&amp; git reset -q --hard 16958dfcee27dd9c33855ecece0013428e2c57c8 &amp;&amp; git clean -q -d -x -f; else git clone -q -b master git@bitbucket.org:rdudacz/looky.co.git /home/deployer/looky/shared/cached-copy &amp;&amp; cd /home/deployer/project_name/shared/cached-copy &amp;&amp; git checkout -q -b deploy 16958dfcee27dd9c33855ecece0013428e2c57c8; fi"
      servers: ["IP"]
  *** [deploy:update_code] rolling back
    * executing "rm -rf /home/deployer/project_name/releases/20140216120957; true"
      servers: ["IP"]
   ** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: IP (Net::SSH::AuthenticationFailed: Authentication failed for user deployer@IP)
  connection failed for: IP (Net::SSH::AuthenticationFailed: Authentication failed for user deployer@IP)
  </code></pre>
  
  <p>What happened here? Where to start with looking for the issue?</p>