简体   繁体   English

ssh-agent,capistrano并将密钥转发到github

[英]ssh-agent, capistrano and forwarding keys to github

I have quite a strange issue with Capistrano deployment, my colleagues machine works fine but mine refuses to play nice. 我对Capistrano的部署有一个很奇怪的问题,我的同事们的机器工作正常,但是我的机器拒绝打好。

I am using cygwin and have an external ruby installation. 我正在使用cygwin,并具有外部ruby安装。

We are using the root user on our server and have added ssh-keys to ./ssh/authorized_keys2 which allows me to deploy and ssh into the server. 我们正在服务器上使用root用户,并已将ssh-key添加到./ssh/authorized_keys2中,这使我可以将ssh部署和ssh到服务器中。

The problem becomes apparent when trying to clone a submodule to the remote cache. 当尝试将子模块克隆到远程缓存时,问题变得很明显。 I always get the error publickey denied. 我总是得到错误的公钥被拒绝。

Below is the deploy file: 以下是部署文件:

# 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}

I realise I will not have included enough information, just let me know what gaps need filling as it is slowly driving me insane why mine fails and my colleagues works flawlessly. 我意识到我不会提供足够的信息,只是让我知道需要填补哪些空白,因为这正缓慢地使我发疯,为什么我的失败以及我的同事们的工作无懈可击。 Any help would be great I have been looking on here and other various sources all day and nothing has sorted this issue. 我整天一直在这里和其他各种来源中寻找任何帮助,都将非常有用,但没有任何事情可以解决此问题。

The whole issue with this was cygwin. 整个问题是cygwin。 I had an install which linked to a ruby library installed in Windows c:\\ which I presume was then trying to use the incorrect key or not finding it at all so simply downloading the ruby source and installing it direct to cygwin solved all my problems! 我有一个链接到Windows c:\\中安装的ruby库的安装程序,我认为这是尝试使用不正确的密钥或根本找不到它的方法,因此只需下载ruby源并将其直接安装到cygwin就可以解决我的所有问题!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM