我想部署我的rails應用程序(Ruby 2.1.2 and Rails 4.1.4
)通過capistrano
從mac。我在服務器上設置了ssh
密鑰。但是,每當我嘗試部署時,我都會收到身份驗證錯誤。錯誤是:Ssh身份驗證錯誤,同時部署使用capistrano
SSHKit::Runner::ExecuteError: Exception while executing on host xxx.xxx: Authentication failed for user [email protected]
依次爲:
Net::SSH::AuthenticationFailed: Authentication failed for user [email protected]
這是我staging.rb:
server "xxx.xx.xxx", user: "deploy", roles: %w{web app db}
set :ssh_options, {
user: "root",
forward_agent: false,
keys: '~/.ssh/id_rsa',
auth_methods: %w(publickey password)
}
set :branch, "master"
set :rails_env, "staging"
我能夠通過使用ssh [email protected]
終端登錄到服務器,但無法登錄Capistrano的。任何幫助或建議都會被修改。
用戶'deploy @ xxx.xx'認證失敗,而不是'root @ xxx.xx'。糾正'staging.rb'文件的第一行。 – Mareq