【发布时间】:2010-09-29 22:45:34
【问题描述】:
Capistrano 每次部署时都会要求我输入密码。怎么做 我不让它发生?
ruby 版本 1.8.7 REE
capistrano 版本 2.5.19
这是我的 capfile 和目录权限。
Everything up-to-date
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote g...@github.com: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 g...@github.com: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
更新
好的,我现在一团糟,现在我收到了这个错误。
我添加了一个“部署”用户,例如..
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
请帮忙!
【问题讨论】:
-
您的新错误是因为您的新用户“部署”可能无权访问您尝试从 git 更新的文件。只需将 .ssh/config 文件中的用户重命名为您正在连接的原始用户...