sudo: Sorry, you must have a tty to run
作者:互联网
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.
标签:set,run,sudoers,sudo,requiretty,file,Sorry,line 来源: https://www.cnblogs.com/longchang/p/10795112.html