2010-09-29 89 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