所以我想能够上限:部署而不必键入任何密码。我已经设置了所有的私钥,所以我可以得到远程服务器的罚款,现在使用svn在ssh,所以没有密码在那里。
So I want to be able to cap:deploy without having to type any passwords. I have setup all private keys so I can get to the remote servers fine, and am now using svn over ssh, so no passwords there.
我有一个最后一个问题,我需要能够重新启动nginx。现在我有sudo /etc/init.d/nginx重新加载。这是一个问题b / c它使用capistrano密码,我刚刚删除b / c我正在使用密钥。任何关于如何重新启动nginx的想法w?输入密码?
I have one last problem, I need to be able to restart nginx. Right now I have sudo /etc/init.d/nginx reload. That is a problem b/c it uses the capistrano password, the one I just removed b/c I am using keys. Any ideas on how to restart nginx w\out a password?
推荐答案我刚刚花了一个小时看着sudoer通配符,就像试图解决这个确切的问题。实际上,你真正需要的是一个可重新启动nginx的根脚本。
I just spent a good hour looking at sudoer wildcards and the like trying to solve this exact problem. In truth, all you really need is a root executable script that restarts nginx.
将它添加到/ etc / sudoers文件中
Add this to the /etc/sudoers file
username hostname ALL=NOPASSWD: /path/to/script以root身份写脚本
#! /bin/bash /bin/kill -HUP `cat /var/run/nginx.pid`使脚本可执行
测试。
sudo /path/to/script更多推荐
重新启动没有sudo的nginx?
发布评论