【问题标题】:Cannot deploy an app with git to EC2无法使用 git 将应用程序部署到 EC2
【发布时间】:2013-05-24 15:45:30
【问题描述】:

我已经设置了亚马逊 EC2 实例(工作)和 Github 存储库(工作良好)。 当我尝试使用 Github 存储库将应用程序部署到 EC2 时,我收到此错误:

 ** [IP] Permission denied (publickey).
 ** [IP] fatal: Could not read from remote repository.
 **
 ** Please make sure you have the correct access rights
 ** and the repository exists.

我错过了什么?我可以使用 copy 将应用程序部署到 EC,但不能使用 github。

我需要什么来设置公钥?

编辑:设置

set :application, "project_name"
set :user, 'username'
set :password, "password"

set :domain, "IP.amazonaws.com"
set :deploy_to, "/path_to_directory"
set :use_sudo, false

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

set :assets_role, [:app]

default_run_options[:pty] = true
set :repository, "git@github.com:user/repo.git"
set :scm, "git"

谢谢

【问题讨论】:

    标签: ruby-on-rails ssh amazon-ec2 capistrano public-key


    【解决方案1】:

    开始使用 Capistrano 时调试访问权限的最佳方法之一是尝试在没有它的情况下访问您的服务器。

    【讨论】:

      【解决方案2】:

      您尚未根据错误消息正确设置 EC2 和 Github 之间的 SSH 密钥,但鉴于您提供的信息,无法提供建议。

      问题 - 您是否在 EC2 服务器上设置了部署密钥?我假设您正在尝试从 EC2 服务器而不是使用 SSH 代理转发的本地计算机进行部署。你能从 EC2 服务器上做一个 git pull 到 github 账户吗?你可以 ssh 到 git@github.com(例如“ssh -T git@github.com”)吗?

      以下链接可帮助您设置部署密钥或找出另一种管理部署的方法。

      https://help.github.com/articles/deploying-with-capistrano

      https://help.github.com/articles/managing-deploy-keys

      【讨论】:

      • 您好威廉,谢谢您的回答。请检查更新的 OP,我添加了有关部署的信息
      猜你喜欢
      • 2015-12-31
      • 2011-07-29
      • 2011-06-28
      • 2013-09-29
      • 1970-01-01
      • 1970-01-01
      • 2016-09-29
      • 2017-02-01
      • 2014-11-13
      相关资源
      最近更新 更多