Capifony Net :: SSH :: AuthenticationFailed

时间:2014-06-09 04:08:39

标签: ssh capifony

希望你能帮助我解决这个问题。

在部署服务器上,我创建了一个用户deploy,并将我localhost的公钥上传到服务器home/users/deploy/.ssh/authorized_keys

但每次运行cap deploy:setup时,localhost都会返回此消息:

  * 2014-06-08 23:58:53 executing `deploy:setup'
  * executing "mkdir -p /var/www/projectplanner /var/www/projectplanner/releases /var/www/projectplanner/shared"
servers: ["XXX.XXX.XXX.XXX"]
connection failed for: XXX.XXX.XXX.XXX:YYYY (Net::SSH::AuthenticationFailed: Authentication failed for user deploy@XXX.XXX.XXX.XXX

这是我的deploy.rb:

set :application, "projectplanner"
set :domain,      "XXX.XXX.XXX.XXX:YYYY"
set :deploy_to,   "/var/www/projectplanner"
set :app_path,    "app"

set :repository,  "my_remote_git"
set :scm,         :git

set :user,        "deploy"

set :branch,      "release"
set :deploy_via,  :remote_cache

set :model_manager, "doctrine"

role :web,        domain
role :app,        domain, :primary => true

set :keep_releases,  3
set :ssh_options, { :keys => %w(/root/.ssh/id_rsa) }
set :use_sudo,    false

logger.level = Logger::MAX_LEVEL

1 个答案:

答案 0 :(得分:0)

首先尝试通过ssh从您的计算机连接到远程主机,并检查是否有任何错误。 然后,您可以尝试从deploy.rb中删除该行:

  

set:ssh_options,{:keys => %w(/root/.ssh/id_rsa)}

或使用用户deploy

的正确路径进行更改

如果您已经解决了问题,请与我们分享您的解决方案或检测到的问题。