Bug 402

Summary: sudo requires a tty even if -S is used
Product: Sudo Reporter: Paul Fox <paulfoxpf>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED INVALID    
Severity: normal    
Priority: low    
Version: 1.7.2   
Hardware: PC   
OS: Linux   

Description Paul Fox 2010-04-03 11:52:10 MDT
sudo requires a tty if "requiretty" is specified in /etc/sudoers, even if the calling application specifies the -S option.

On some servers, this prevents non-terminal applications from using sudo and passing the password to STDIN. The option "requiretty" should be enforced only if the user of sudo does not explicitly disable the "terminal mode" with -S (confirming that terminal echo does not need to be disabled).
Comment 1 Todd C. Miller 2010-05-07 13:04:43 MDT
The" requiretty" option is behaving as intended; the user should not be able to override the requirement for a tty specified in sudoers via a command line flag.

If you simply wish to prevent a password from being echoed to the standard output in the normal case there is no need to use the "requiretty" option.  Since version 1.7.0 sudo will refuse to read a password if no tty is present and the -S flag was not specified unless the "visiblepw" option is enabled in sudoers.