I keep getting this error (OpenSSL::PKey::PKeyError: not a public key "/var/www/.ssh/id_rsa.pub")

Thanks in advance.

My deploy.rb looks like this:

 set :application, "goom" set :domain, "[email protected]" set :deploy_to, "/var/www/goom" #set :app_path, "app" set :repository, "/var/www/goom/.git" set :scm, :git set :deploy_via, :copy # Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, $ set :model_manager, "doctrine" # Or: `propel` role :web, domain # Your HTTP server, Apache/etc role :app, domain # This may be the same as your$ role :db, domain, :primary => true # This is where Rails migratio$ 

2 Answers

It turnes out that it is a format issue. Originally my public key had the following format:

---- BEGIN SSH2 PUBLIC KEY ---- Comment: "rsa-key-20101206" AAAAB3NzaC1yc2EAAAABJQAAAQB80B66jlf+Xo3E0d6TJdojKB1mkblUCjyCaOA1 p2GpvQr+TjtCugdmh9069ybWcJCaRcvJu12pz/0iO8H0Ar/f3AiULaj6VHF9rdkA qp+k+Ih0ep204VENqgobGfDOKfBcd2o9P1zdbCuie28tGSxoQMZNVVPMXPgl80HQ v8+dqL4YDEvsViOMa/A1pxlvw74XwU6jzaVM+4u2ysKu0xEJzSUR4wT4s7f0zr3G FNZDlj0vmuyggo9/3BIgtAQC9IcALqT5Jf3V5iN03+8uPUJVuy+XvIJoZJo5fnrT zXzDBdUmjJNt+zTYsX3/fHQZOxokHPiBQQ5OTL+NW1Uscukv ---- END SSH2 PUBLIC KEY ---- 

Reformatting it to the following did the trick:

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQB80B66jlf+Xo3E0d6TJdojKB1mkblUCjyCaOA1p2GpvQr+TjtCugdmh9069ybWcJCaRcvJu12pz/0iO8H0Ar/f3AiULaj6VHF9rdkAqp+k+Ih0ep204VENqgobGfDOKfBcd2o9P1zdbCuie28tGSxoQMZNVVPMXPgl80HQv8+dqL4YDEvsViOMa/A1pxlvw74XwU6jzaVM+4u2ysKu0xEJzSUR4wT4s7f0zr3GFNZDlj0vmuyggo9/3BIgtAQC9IcALqT5Jf3V5iN03+8uPUJVuy+XvIJoZJo5fnrTzXzDBdUmjJNt+zTYsX3/fHQZOxokHPiBQQ5OTL+NW1Uscukv 

I figured it out.

As you can see in the first line:

(OpenSSL::PKey::PKeyError: not a public key "/var/www/.ssh/id_rsa.pub") 

Ruby claims to be looking in the /var/www/.ssh folder... it's not.

It's actually defaulting... for whatever insane reason... to /var/www/ So all I did was copy id_rsa and id_rsa.pub to /var/www and it ran just fine.

Never actually got it to DEPLOY mind you... (I eventually used Git for that)... but I did get past this error!

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.