【问题标题】:Capistrano ssh_options aws deploy issueCapistrano ssh_options aws部署问题
【发布时间】:2013-09-26 01:38:42
【问题描述】:

所以我尝试通过 capistrano 部署应用程序,但尽管尝试了几种格式来引用 pem 文件,但它反复询问我的密码。 pem 文件位于 rails 项目的根目录中,名为 highlandsapptestdeploy。这是我的代码:另外,我不确定我的服务器引用是否正确?

set :application, "highlandsfacebookart"
set :repository,  "https://onenoc@bitbucket.org/onenoc/highlands-coffee-art-app.git"

set :user, 'deploy'
set :use_sudo, false
set :deploy_to, "/var/www/#{application}#"
set :deploy_via, :remote_cache
ssh_options[:keys] = %w(/highlandsapptestdeploy/highlandsfbkey.pem)


# set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess based on known version control directory names
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`

role :web, "ec2-54-200-24-60.us-west-2.compute.amazonaws.com"                          # Your HTTP server, Apache/etc
role :app, "ec2-54-200-24-60.us-west-2.compute.amazonaws.com"                          # This may be the same as your `Web` server
role :db,  "ec2-54-200-24-60.us-west-2.compute.amazonaws.com", :primary => true # This is where Rails migrations will run
role :db,  "ec2-54-200-24-60.us-west-2.compute.amazonaws.com"

【问题讨论】:

    标签: ruby-on-rails amazon-web-services capistrano


    【解决方案1】:

    我感觉您的用户名不正确。你确定是“部署”吗?

    【讨论】:

      【解决方案2】:

      您还需要让ssh-agent 在您的机器上工作。一旦代理正常工作,您应该能够在不提供密码或密码短语的情况下将ssh 进入机器。然后你需要告诉 Capistrano 转发来自代理的身份验证。

      ssh_options[:forward_agent] => true
      

      【讨论】:

      • 所以我将 highlandsfbkey.pem 移动到 ~/.ssh,并将 ssh_options[:keys] = %w(/highlandsapptestdeploy/highlandsfbkey.pem) 更改为 ssh_options[:keys] = %w(~ /.ssh/highlandsfbkey.pem) 。然后我做了 ssh-add ~/.ssh/highlandsfbkey.pem,它成功了,并添加了你的行,但它仍然要求输入密码。我错过了什么?
      • 您仍然需要确保ssh-agent 正在运行,并且您已使用ssh-add 向代理验证了自己。
      • 当我输入 ssh-agent 我得到 SSH_AUTH_SOCK=/tmp/ssh-hGdAzqmk1870/agent.xxxx;导出 SSH_AUTH_SOCK; SSH_AGENT_PID=xxxx;导出 SSH_AGENT_PID;回声代理 pid xxxx;这意味着它运行正常?
      • 是的,现在执行ssh-add,然后确保您可以在没有密码/密码短语的情况下通过 ssh 连接到服务器。
      • 我成功地完成了所有这些,但是当我执行 cap deploy:setup 时它仍然要求输入密码:(。
      猜你喜欢
      • 2014-02-24
      • 2014-07-07
      • 2014-05-30
      • 1970-01-01
      • 1970-01-01
      • 2011-05-15
      • 1970-01-01
      相关资源
      最近更新 更多