Search code examples
ruby-on-railsgitcapistranopublic-key-encryptiondreamhost

how to resolve ssh key rejection while deploying 1st Rails3 app?


I'm trying to deploy a Rails3 application, for the 1st time, to Dreamhost using Git & Capistrano. Using Dreamhost's Capistrano setup instructions. Down to one last error:

Cap deploy:check => looks good.
Cap deploy:setup => looks good.

However, Cap deploy:cold => fails:

** [alvarez.dreamhost.com :: out] Permission denied (publickey).
** [alvarez.dreamhost.com :: out] fatal: The remote end hung up unexpectedly

My config/deploy.rb file contains, among other variables,

ssh_options[:keys] = %w(/home/bubby/.ssh/id_rsa)        
set :chmod755, "app config db lib public vendor script script/* public/disp*"
set :use_sudo, false

Public key setup completed on home PC. (Ubuntu.) Working with GitHub repository.

Have copied public key to domain directory per DH's instructions.

Any suggestions? Reaching the limit of DH's help capabilities. Thanks.


Solution

  • Please set the repository url to the read-only version:

    set :repository, "https://github.com/bjpcjp/catalog.git"

    Otherwise git is trying to use your private ssh key to authenticate against GitHub. This fails on server unless you take additional actions.