I\'m trying to login to a ssh server and to execute something like:
ssh user@domain.com \'sudo echo \"foobar\"\' >
ssh user@domain.com \'sudo echo \"foobar\"\'
There are two ways to get rid of this error message. The easy way is to provide a pseudo terminal for the remote sudo process. You can do this with the option -t:
-t
ssh -t user@domain.com 'sudo echo "foobar"'