I keep getting this error and have tried several ways discussed online to fix this and none are working for me. I have setup SSH keys so when I run 'ssh newton@host.com'
it automatically logs me in, I have also set this user in visudo
to be 'newton ALL=(ALL:ALL) ALL'
I then also tried to add 'newton ALL=NOPASSWD: /var/www/script.sh'
Unfortunately, every time I run ssh newton@host.com 'sudo /var/www/script.sh'
from Cygwin I get back. I have also tried to add -t -t
but then it prompts me for the password.
total size is 21209180 speedup is 314.69
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts
ssh example.com sudo echo hello
from one Linux system to another. I've updated your title accordingly. I've also flagged your question for migration to the Unix site. – Keith Thompson Sep 18 '12 at 21:33