0

我已经设置了亚马逊 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"

谢谢

4

2 回答 2

0

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

于 2014-02-22T20:04:00.227 回答
0

您尚未根据错误消息正确设置 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

于 2013-05-29T11:47:34.880 回答