I noticed sudo
does not work if fds 0/1/2 are not bound to a terminal.
I read that one fix is to delete requiretty
, but this line isn't in /etc/sudoers
, neither in the included directory @includedir /etc/sudoers.d
.
I noticed sudo
does not work if fds 0/1/2 are not bound to a terminal.
I read that one fix is to delete requiretty
, but this line isn't in /etc/sudoers
, neither in the included directory @includedir /etc/sudoers.d
.
On modern versions of sudo
in distributions like Kali, requiretty
might be one of the compiled-in defaults.
If you are already root, sudo -V
(note: upper-case V) should tell you the build-time conqman qfiguration options used with sudo
, and other configuration information. If you are running as a regular user that has permission to run commands (but not a shell) as root through sudo
, you can get this information with sudo sudo -V
.
If sudo
seems to default to requiretty
behavior for any reason, and there is no explicit requiretty
setting to remove, then you can always add an explicit setting to disable it. Just add this line to /etc/sudoers
:
Defaults !requiretty
man sudoers
– Chris Davies Dec 20 '21 at 14:19