码迷,mamicode.com
首页 > 其他好文 > 详细

sudo: Sorry, you must have a tty to run

时间:2019-04-30 12:13:14      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:hat   visudo   def   ret   style   python   read   rip   use   

The requiretty option in sudoers file

The requiretty if set in sudo config file sudoers, sudo will only run when the user is logged in to a real tty. When this flag is set, sudo can only be run from a login session and not via other means such as cron, shell/perl/python or cgi-bin scripts. This flag is set on many distores by default. Edit /etc/sudoers, file, enter:
# visudo
Find line that read as follows:

Defaults    requiretty

Either comment it out the line or delete the line:

#Defaults    requiretty

Save and close the file.

sudo: Sorry, you must have a tty to run

标签:hat   visudo   def   ret   style   python   read   rip   use   

原文地址:https://www.cnblogs.com/longchang/p/10795112.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!