Bug 276

Summary: [Sudo 1.6.8p12] Visible password when sudo is executed through ssh
Product: Sudo Reporter: Andrej Elias <andrej.elias>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED INVALID    
Severity: normal    
Priority: normal    
Version: 1.6.8   
Hardware: PC   
OS: Linux   

Description Andrej Elias 2008-01-27 16:29:29 MST
When I execute remote command with sudo through ssh, sudo asks for password, but the password is visible on terminal.

u1@PC1:~$ ssh u2@PC2 'sudo /etc/init.d/dnsmasq restart'
u2@PC2's password:
Password:MyPassWord
Restarting DNS forwarder and DHCP server: dnsmasq.
u1@PC1:~$ 

Tested on Sudo version 1.6.8p12
sshd: OpenSSH_4.3p2 Debian-8ubuntu1.1, OpenSSL 0.9.8c 05 Sep 2006
Comment 1 Todd C. Miller 2008-01-27 16:45:17 MST
Not a bug.  If you do not specify the -t flag to ssh it will not allocate a pseudo-tty.  Without a tty it is not possible for sudo (or anything else) to turn off echo.

If you run it thusly:

u1@PC1:~$ ssh -t u2@PC2 'sudo /etc/init.d/dnsmasq restart'

echo will be disabled during password entry.