git - SSHKit::Runner::ExecuteError:在主机 Net::SSH::AuthenticationFailed 上执行时出现异常:身份验证失败

标签 git ruby-on-rails-4 ssh capistrano3

尝试使用 Capistrano 3 部署 Rails 应用程序,当我运行此命令时,出现此错误

vagrant@vagrant-ubuntu-utopic-32:/vagrant$ cap production deploy
INFO [e4213f70] Running /usr/bin/env mkdir -p /tmp/career/ on 192.168.51.54
DEBUG [e4213f70] Command: /usr/bin/env mkdir -p /tmp/career/
Text will be echoed in the clear. Please install the HighLine or Termios librari
es to suppress echoed text.
@192.168.51.54's password:secert
@192.168.51.54's password:secert
@192.168.51.54's password:secert
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host 192.168.51.54: A
uthentication failed for user @192.168.51.54

Net::SSH::AuthenticationFailed: Authentication failed for user @192.168.51.54

Tasks: TOP => git:check => git:wrapper
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing on host 192.168.5
1.54: Authentication failed for user @192.168.51.54

我看到了一些帖子[ 1 , 2 ] 在堆栈溢出中。但我仍然遇到错误。

这是我的 Capfile:

require 'capistrano/setup'
set :stage, :production
require 'capistrano/deploy'
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

部署.rb文件:

lock '3.4.0'
set :application, "career"
set :repo_url, "https://github.com/mezbahalam/offender_profile"

set :user, 'vagrant'
# set :scm_passphrase, "password"
set :deploy_to, "/home/vagrant/apps/career"
set :use_sudo, false
set :scm, :git
server "192.168.51.54",  roles: [:app, :web, :db], :primary => true 

我做错了什么?

最佳答案

尝试为部署设置 ssh key 。确保您的公钥在服务器上的授权 key 列表中,并且它是 chmod 600。

关于git - SSHKit::Runner::ExecuteError:在主机 Net::SSH::AuthenticationFailed 上执行时出现异常:身份验证失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31102344/

相关文章:

git - 文件夹未推送到 GitHub,仅显示为图标

mysql - 设计助手返回零

ruby-on-rails - Redmine 慢速 View 渲染

ssh - 如何使用具有不同端口的 scp URI?

Git 删除历史提交

git pull master 出现错误 : fatal: couldn't find remote ref master

php - 使用 ssh 从 github 部署到 linux 服务器但权限被拒绝(公钥)。 PHP脚本

python - 使用 Fabric/Paramiko 遍历 SOCKS5 代理时无输出

git - TortoiseGit,在每个文件的基础上配置自动 merge 工具

email - 生产中的 rails 4 电子邮件预览