I have the following script, which works:
echo -n "Enter sudo password: "
read -s sudo_pass
echo "$sudo_pass" | ssh -tt myhost "sudo -S ./remote_script.sh"
The problem is the output. I'd like the password from stdin to be used by sudo, but NOT be printed to the screen. Instead, I get:
<system banner>
thepassw0rd
[sudo] password for theuser:
Is there a way to accomplish this? I'm not even sure which command is causing the input to be printed.
UPDATE
I was able to find that the input is being printed by ssh by just doing:
echo 123 | ssh -tt myhost "sleep 2"
which gave me
<system banner>
123
Connection to myhost closed.