我试图使用部署Capistrano的一个项目。 我的机器运行的是Windows 7; 我部署到服务器就是Linux。
在deploy.rb脚本,下面的设置:
ssh_options[:forward_agent] = true
Capistrano酒店脚本通过在本地运行一个git命令,在这一点上,我提示输入密码为我的SSH密钥开始了:
* executing `deploy:update_code'
executing locally: "git ls-remote git@github.com:pathto/gitproject.git develop"
Enter passphrase for key '/c/Users/Sam/.ssh/id_rsa':
command finished in 6999ms
(我已经移除,你很可能会看到上面的真正的Git路径。)
我输入密码,并能正常工作。 然而,Capistrano的然后尝试做远程机器(在下面更名为staging-server.com)类似的东西,我得到一个错误 - 看到这个提取的最后一行:
[staging-server.com] executing command
[staging-server.com] sh -c 'git clone git@github.com:pathto/gitproject.git /home/perstest/releases/20120412074500 && cd
/home/perstest/releases/20120412074500 && git checkout -b deploy 50eaf06d06d66fd20c3e55038276f420d8c308a8 && (echo 50eaf06d06d66fd20c3e55038
276f420d8c308a8 > /home/perstest/releases/20120412074500/REVISION)'
** [staging-server.com :: out] Initialized empty Git repository in /home/perstest/releases/20120412074500/.git/
** [staging-server.com :: err] Error reading response length from authentication socket.
如果我注释掉deploy.rb的forward_agent线,该安装成功,想必使用从部署服务器本身的关键。
我的SSH密钥似乎是工作-毕竟,最初的git命令的工作,我可以在混帐推使用/拉和ssh -T git@github.com报告的是它应该(建议在github上:帮助 )。
我以为,当远程服务器问他们我的机器不是服务键。 一个可怕的很多谷歌搜索后,我发现在建议http://hustoknow.blogspot.co.uk/2011/06/ssh-agent-and-agent-forwarding-on.html ,解释如何得到的ssh-agent在启动时运行。 我是从命令提示符下做这一切,让我再切换到混帐bash和建立我的.bash_profile为包括我已经联系到脚本。
添加此之后,我被提示输入密码我第一次的时候推出的git bash和然后我可以连接使用SSH密钥(而无需重新输入密码)到GitHub上。 此外,SSH-添加-L报道,确实有钥匙可用。 所以,一切似乎是正确的设置!
但是,我还是得到了“从身份验证插槽读取错误响应长度。” 错误。
有任何想法吗? 这适用于我的同事(相同deploy.rb文件),它的开发机器是Linux操作系统。