0

Issue

(Backtrace restricted to imported tasks) cap aborted! Net::SSH::AuthenticationFailed: Authentication failed for user user@xxyy

Tasks: TOP => rvm:check (See full trace by running task with --trace)

I am following this tutorial to deploy rails app into my ec2 instance and am at the step where I key in cap production deploy

I have tried the solutions in this post, but am unable to resolve the situation.

Also, I have checked to ensure that my .pem file is located in the .ssh folder in my home directory. I am able to manually ssh into my ec2 instance.

How do I overcome the error above?

Notes:

1) Content of my production.rb

server 'xx.yyy.zz', user: 'abc', roles: %w{web app db}

2) net-ssh version is 3.1.1. I did not specify this gem in my Gemfile, but still found it from Gemfile.lock.

Community
  • 1
  • 1
RPV
  • 397
  • 1
  • 5
  • 16
  • could you paste your `production.rb` file content? what is your `net-ssh` gem version? – Emu May 15 '16 at 07:51
  • sure, have included in the post. – RPV May 15 '16 at 07:58
  • 1
    Did you create the `deploy` user? Did you copy the public RSA key to the `authorized_keys` file of the deploy user on AWS? Can you re-check that you followed all the steps of the *"Setup the server"* tutorial chapter? You should be able to log in without needing the `-i` option and your PEM file, to the `deploy` account on AWS, just using the keys. – Matouš Borák May 15 '16 at 08:00
  • 1. where is your `ssh_options` in production.rb file? 2. `net-ssh` gem should be added on the gemfile. version 2.7 – Emu May 15 '16 at 08:00
  • Is it pulling from your Git depository host like Bitbucket? The server's public key is allowed to read from this repository? – fschuindt May 15 '16 at 08:02
  • Yes, I did create `deploy` . Am using bitbucket - is the approach different than from github? Checking up on the rest – RPV May 15 '16 at 08:14
  • And are you able to log in manually as the `deploy` user without any options / passwords? – Matouš Borák May 15 '16 at 09:30
  • I'm able to login manually like this - ssh -i ".../abcd.pem" ubuntu@ec2instancenurl – RPV May 15 '16 at 09:34

0 Answers0