I am trying to deploy my rails application (Ruby 2.1.2 and Rails 4.1.4) through capistrano from mac. I have ssh keys set up on server. But i keep getting authentication error whenever i try to deploy. The error is:
SSHKit::Runner::ExecuteError: Exception while executing on host xxx.xxx: Authentication failed for user [email protected]
followed by:
Net::SSH::AuthenticationFailed: Authentication failed for user [email protected]
This is my staging.rb:
server "xxx.xx.xxx", user: "deploy", roles: %w{web app db}
set :ssh_options, {
user: "root",
forward_agent: false,
keys: '~/.ssh/id_rsa',
auth_methods: %w(publickey password)
}
set :branch, "master"
set :rails_env, "staging"
I am able to login to server via terminal using ssh [email protected] but cannot login with capistrano. Any help or advice will be appericiated.
[email protected], not[email protected]. Correct first row of thestaging.rbfile.