Home  >  Q&A  >  body text

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 days ago881

reply all(1)I'll reply

  • 某草草

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

    vim /etc/sudoers

    • Disable "ssh hostname sudo <cmd>", because it will show the password in clear.
    • Defaults requiretty #Comment out this line

    In addition, I remember that your capistrano also requires a deployment password.
    set :password, "user1" #Password to log in to the deployment machine. If there is no deployment, you need to enter the password

    reply
    0
  • Cancelreply