部署期间的Capifony错误(OpenSSL :: PKey :: PKeyError:不是公钥"/var/www/.ssh/id_rsa.pub")

mys*_*ola 2 capistrano ssh-keys capifony

我一直收到这个错误 (OpenSSL::PKey::PKeyError: not a public key "/var/www/.ssh/id_rsa.pub")

提前致谢.

我的deploy.rb看起来像这样:

  set :application, "goom"
    set :domain,      "goom@bloom.com"
    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$
Run Code Online (Sandbox Code Playgroud)

小智 9

事实证明这是一个格式问题.最初我的公钥具有以下格式:

---- 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 ----
Run Code Online (Sandbox Code Playgroud)

将其重新格式化为以下功能:

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQB80B66jlf+Xo3E0d6TJdojKB1mkblUCjyCaOA1p2GpvQr+TjtCugdmh9069ybWcJCaRcvJu12pz/0iO8H0Ar/f3AiULaj6VHF9rdkAqp+k+Ih0ep204VENqgobGfDOKfBcd2o9P1zdbCuie28tGSxoQMZNVVPMXPgl80HQv8+dqL4YDEvsViOMa/A1pxlvw74XwU6jzaVM+4u2ysKu0xEJzSUR4wT4s7f0zr3GFNZDlj0vmuyggo9/3BIgtAQC9IcALqT5Jf3V5iN03+8uPUJVuy+XvIJoZJo5fnrTzXzDBdUmjJNt+zTYsX3/fHQZOxokHPiBQQ5OTL+NW1Uscukv
Run Code Online (Sandbox Code Playgroud)