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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="670049494927000e130f12054904080a" rel="noreferrer noopener nofollow">[email protected]</a>: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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="60074e4e4e200709140815024e030f0d" rel="noreferrer noopener nofollow">[email protected]</a>: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
请帮忙!
最佳答案
Github 可能会要求您提供密码,因为从您的服务器连接时它没有获取您的 ssh key 。在 ~/.ssh/config
中设置代理转发:
Host my_deploy_server
Hostname 1.2.3.4
User deploy
ForwardAgent yes
Host *
ForwardAgent no
关于ruby-on-rails - capistrano 密码提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3826440/