I\'m trying to login to a ssh server and to execute something like:
ssh user@domain.com \'sudo echo \"foobar\"\'
>
Rather than allocating a TTY, or setting a password that can be seen in the command line, do something like this.
Create a shell file that echo's out your password like:
#!/bin/bash
echo "mypassword"
then copy that to the node you want using scp
like this:
scp SudoPass.sh somesystem:~/bin
Then when you ssh
do the following:
ssh somesystem "export SUDO_ASKPASS=~/bin/SudoPass.sh;sudo -A command -parameter"