capistrano密码提示 [英] capistrano password prompt
问题描述
Capistrano不断询问我每次部署的密码。
我怎么不让它发生?
Capistrano keeps asking me for password for every deplyoyment. How do I not let it happen?
红宝石版本1.8.7 REE
ruby version 1.8.7 REE
capistrano版本2.5.19
capistrano version 2.5.19
这是我的capfile和目录权限。
Here is my capfile and directory permissions.
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
更新
好,我陷入了严重的混乱,现在我明白了
OK, i am in a super bad mess, now I get this error.
http://pastie.org/1190332
我添加了一个部署用户,如..
I added a "deploy" user like..
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文件中添加了您提到的配置。
Then I added the configuration you mentioned in my .ssh/config file.
Host prod
Hostname xxx.xxx.xxx.xx
User deploy
ForwardAgent yes
请帮助!
推荐答案
Github可能要求您输入密码,因为它没有得到ssh k从服务器连接时。在〜/ .ssh / config
中设置代理转发:
Github is probably asking for your password because it's not getting your ssh key when connecting from your server. Set up agent forwarding in your ~/.ssh/config
:
Host my_deploy_server
Hostname 1.2.3.4
User deploy
ForwardAgent yes
Host *
ForwardAgent no
这篇关于capistrano密码提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!