2010-09-29 86 views
1

Capistrano不断要求我为每个deplyoyment密码。 我不让它发生?capistrano密码提示

红宝石版本1.8.7 REE

Capistrano的版本2.5.19

这是我capfile和目录权限。

http://pastie.org/1189919

Everything up-to-date 
** transaction: start 
    * executing `deploy:update_code' 
    updating the cached checkout on all servers 
    executing locally: "git ls-remote [email protected]:username/ 
app_name.git master" 
    * executing "if [ -d /var/www/app_name/shared/cached-copy ]; then 
cd /var/www/app_name/shared/cached-copy && git fetch -q origin && git 
reset -q --hard 5d47453e28385200daa971ca4982632caf7fb67e && git clean - 
q -d -x -f; else git clone -q [email protected]:username/app_name.git/
var/www/app_name/shared/cached-copy && cd /var/www/app_name/shared/ 
cached-copy && git checkout -q -b deploy 
5d47453e28385200daa971ca4982632caf7fb67e; fi" 
    servers: ["1xx.2xx.xxx.xxx"] 
Password: 
    [173.230.158.13] executing command 
    command finished 

更新

OK,我在一个超级烂得一塌糊涂,现在我得到这个错误。

http://pastie.org/1190332

我加了一个 “部署” 用户如..

adduser --system --home /home/deploy --shell /bin/bash --ingroup nogroup deploy 
chmod u+w /etc/sudoers 
echo "deploy ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers 
chmod u-w /etc/sudoers 

然后我说你在我的.ssh/config文件中所提到的配置。

Host prod 
    Hostname xxx.xxx.xxx.xx 
    User deploy 
    ForwardAgent yes 

请帮忙!

+0

你的新的错误是因为你的新用户部署“可能不会有机会获得你想从git的更新文件。只需将你的.ssh/config文件中的用户重新命名为你正在连接的原始用户... – 2010-09-30 04:44:50

回答

3

Github可能会询问您的密码,因为从您的服务器连接时,它没有获取您的ssh密钥。设置代理转发在~/.ssh/config

Host my_deploy_server 
    Hostname 1.2.3.4 
    User deploy 
    ForwardAgent yes 

Host * 
    ForwardAgent no 
+0

我的部署服务器在这种情况下是我的桌面从哪里部署? – badnaam 2010-09-29 23:24:56

+0

不,这是您正在部署的服务器的便利名称:按照您的喜好命名它。这也让你可以执行'ssh myserver'而不必拼写'ssh deploy @ myserver.example.com' – 2010-09-29 23:37:56

+1

你不需要在部署脚本中使用'ssh_options [:forward_agent] = true'吗?或者是为了别的吗? – zetetic 2010-09-30 01:21:32

1

这可能是您的服务器的密码。尝试在您正在部署的计算机与目标服务器之间设置共享密钥。

+0

对不起,ssh不是我的优点..我该怎么做? – badnaam 2010-09-29 22:55:53

+1

这是一个教程。介绍如何使用unix和windows来做到这一点。 http://hkn.eecs.berkeley.edu/~dhsu/ssh_public_key_howto.html – 2010-09-29 22:59:24