ruby-on-rails - capistrano 密码提示

标签 ruby-on-rails capistrano

Capistrano 不断要求我提供每次部署的密码。怎么办 我不让它发生吗?

Ruby 版本 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 <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

更新

好吧,我的处境非常糟糕,现在我收到了这个错误。

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

请帮忙!

最佳答案

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/

相关文章:

ruby-on-rails - Rails 4 - 如何在开发中使用 sqlite3 并在生产中使用 PostgreSQL w/Heroku

ruby-on-rails - rspec Controller 测试找不到部分

ruby-on-rails - 以 rails activerecord 样式编写嵌套查询

ruby-on-rails - 如何强制 ActiveStorage::Attached#attach 同步运行——禁用异步行为

github - Capistrano 错误 : Repository not found

ruby-on-rails - Ruby on Rails whenever + capistrano v3 集成

ruby-on-rails - Ruby:如何返回数组列包含给定字符串的所有行?

ruby-on-rails - Capistrano 部署 -- Net::SSH::AuthenticationFailed -- AWS EC2

ruby-on-rails-3 - 使用 Capistrano 将 Ruby on Rails 应用程序部署到 Windows Azure VM 时出现超时错误

docker-compose : Issue with . 环境路径