ssh代理、capistrano和将密钥转发到github



我在部署Capistrano时遇到了一个很奇怪的问题,我的同事的机器工作得很好,但我的拒绝表现得很好。

我正在使用cygwin,并且有一个外部ruby安装。

我们在服务器上使用root用户,并向添加了ssh密钥/ssh/authorized_keys2,它允许我将ssh部署到服务器中。

当尝试将子模块克隆到远程缓存时,问题会变得明显。我总是得到错误公钥被拒绝。

以下是部署文件:

# What is the name of the local application?
set :application, "domain"
# What user is connecting to the remote server?
set :user, "root"
# Where is the local repository?
set :repository, "file:///blah.git"
set :local_repository,  " ssh://blah.git"
# What is the production server domain?
role :web, "vserver"
# What remote directory hosts the production website?
set :deploy_to,   "/home/<user>/public_html/"
# Is sudo required to manipulate files on the remote server?
set :use_sudo, false
# What version control solution does the project use?
set :scm,        :git
set :branch,     'master'
# How are the project files being transferred?
set :deploy_via, :remote_cache
# Maintain a local repository cache. Speeds up the copy process.
set :copy_cache, true
# Ignore any local files?
set :copy_exclude, %w(.git,deployment,.project)
#enabled submodules
set :git_enable_submodules, 1
set :group_writable, false
set :ssh_options, {:forward_agent => true}

我意识到我没有提供足够的信息,只是让我知道需要填补哪些空白,因为这慢慢让我发疯,为什么我的失败了,而我的同事们工作得完美无瑕。任何帮助都会很好,我一整天都在这里和其他各种来源寻找,但没有什么能解决这个问题。

整个问题都是cygwin。我安装了一个链接到Windows c:\中安装的ruby库的程序,我想当时该程序试图使用错误的密钥,或者根本找不到它,所以只需下载ruby源代码并直接安装到cygwin就解决了我所有的问题!

最新更新