首页  >  问答  >  正文

nginx - capistrano 在部署项目时出现"sorry, you must have a tty to run sudo“怎么处理呢?

capistrano 部属一项目,当执行到”sudo xx/xx/xx/nginx -s reload“ 时出现”sorry, you must have a tty to run sudo“这个问题说明什么呢?
ps:
操作系统是centos 5 我也在网上找到一些方法,例如:
http://blog.csdn.net/chinalinuxzend/a...
http://www-01.ibm.com/support/docview...
也照做了。但是没有起作用,反而在部属的时候要我输入:Password: 。有类似的情况吗?

phpcn_u1582phpcn_u15822734 天前880

全部回复(1)我来回复

  • 某草草

    某草草2017-04-24 16:00:58

    vim /etc/sudoers

    • Disable "ssh hostname sudo <cmd>", because it will show the password in clear.
    • Defaults requiretty #将这行注释掉

    另外,我记得你这个capistrano里面也有要部署密码的。
    set :password, "user1" #登录部署机器的密码, 如果不设部署时需要输入密码

    回复
    0
  • 取消回复