I'm trying to login to a ssh server and to execute something like:
ssh firstname.lastname@example.org 'sudo echo "foobar"'
Unfortunately I'm getting an error:
sudo: no tty present and no askpass program specified
Google told me to either set the environment variable
SSH_ASKPASS or to set
askpass in the
sudoers file. My remote machine is running on Debian 6 and I've installed the packages ssh-askpass and ssh-askpass-gnome and my
sudoers file looks like this:
Defaults env_reset Defaults askpass=/usr/bin/ssh-askpass # User privilege specification root ALL=(ALL) ALL user ALL=(ALL) ALL
Can someone tell what I'm doing wrong and how to do it better.