Local Computer Username: Christopher
Ubuntu server username: my_app_name
I followed the Digital Ocean documentation to set up Ubuntu 16.04 server with Ruby on Rails, and I do it for the first time, although when I finish the cap production deploy:initialconsole it returns Net::SSH::AuthenticationFailed: Authentication failed for user Christopher@12.23.34.4512.23.34.45, although I can log in ssh to my root and user accounts without any problems.
I followed these instructions:
How to connect a drop to Digital Ocean https://www.digitalocean.com/community/tutorials/how-to-connect-to-your-droplet-with-ssh
Initial server setup with Ubuntu 16.04
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04
I generated a pair of ssh public / private keys on my local computer using:
ssh-keygen -t rsa
I added the public key from my local computer to the server file ~/.ssh/authorized_keys. After that, I was able to log in to my root account and user.
Then I followed these instructions:
Deploying the Rails app on Ubuntu 14.04 with Capistrano, Nginx, and Puma https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx- and- cougar
I generated another ssh key, this time on the server, and added the public key to the list of deployment keys on github. After that, I was able to successfully clone the repo via ssh.
I run the following commands:
cat ~/.ssh/id_rsa.pub | ssh -p your_port_num deploy@your_server_ip 'cat >> ~/.ssh/authorized_keys'
cap production deploy:initial
And come back
Net::SSH::AuthenticationFailed: Authentication failed for user Christopher@12.23.34.45
, Ubuntu, , . .