This error message will occur if sudo is not able to ask for the password (no tty is present) (like for instance when trying to sudo rsync).
One solution to this is to add the line “Defaults visiblepw” to the /etc/sudoers file.
[Todd C. Miller Todd.Miller at courtesan.com said on sudo-users: Recent versions of sudo will refuse to prompt for a password if no tty is present, since it is not possible to turn off echo in this case. You can restore the old behavior with a line like above]