Bugzilla – Bug 276
[Sudo 1.6.8p12] Visible password when sudo is executed through ssh
Last modified: 2008-01-27 16:45:17 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
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.