sudo: sorry, you must have a tty to run sudo

需要远程到机器上去执行sudo -u 的命令,遇到如下错误:

sudo: sorry, you must have a tty to run sudo

 

解决办法:

在/etc/sudoers文件中做如下修改:
注释掉:Defaults    requiretty所在的行。即:

你可能感兴趣的:(sudo: sorry, you must have a tty to run sudo)