title: Net::SSH::AuthenticationFailed: Authentication failed for user
body: <p><strong>Local Computer Username: Christopher</strong></p>
  
  <p><strong>Ubuntu Server Username: my_app_name</strong></p>
  
  <p>I have followed the Digital Ocean documentation to set up an Ubuntu 16.04 server with Ruby on Rails and is my first time doing so, though when I get to <code>cap production deploy:initial</code> the console returns <code>Net::SSH::AuthenticationFailed: Authentication failed for user Christopher@12.23.34.45</code> even though I am able to ssh without a problem into my root and user accounts.</p>
  
  <p>I followed these instructions:</p>
  
  <p><strong>How to connect your droplet with Digital Ocean</strong>
  <a href="https://www.digitalocean.com/community/tutorials/how-to-connect-to-your-droplet-with-ssh" rel="noreferrer">https://www.digitalocean.com/community/tutorials/how-to-connect-to-your-droplet-with-ssh</a></p>
  
  <p><strong>Initial Server Setup with Ubuntu 16.04</strong><br>
  <a href="https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04" rel="noreferrer">https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04</a></p>
  
  <p>I generated an ssh public/private key pair on my local computer using:</p>
  
  <pre><code>ssh-keygen -t rsa
  </code></pre>
  
  <p>I added the public key from my local computer to the servers <code>~/.ssh/authorized_keys</code> file. I was then able to ssh into my root and user accounts.</p>
  
  <p>I then followed these instructions:</p>
  
  <p><strong>Deploying a Rails App on Ubuntu 14.04 with Capistrano, Nginx, and Puma</strong>
  <a href="https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma" rel="noreferrer">https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma</a></p>
  
  <p>I generated another ssh key, this time on the server and added the public key to my github's deploy keys list. I was then able to successfully clone my repo through ssh.</p>
  
  <p>I run the following commands:</p>
  
  <pre><code>cat ~/.ssh/id_rsa.pub | ssh -p your_port_num deploy@your_server_ip 'cat &gt;&gt; ~/.ssh/authorized_keys'
  
  cap production deploy:initial
  </code></pre>
  
  <p>And get back:</p>
  
  <pre><code>Net::SSH::AuthenticationFailed: Authentication failed for user Christopher@12.23.34.45
  </code></pre>
  
  <p>I would really appreciate any help as this is my very first time deploying to an Ubuntu server and I would really like to learn what it is I'm doing wrong. Thank you in advance.</p>