Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

How to fix 'sudo: no tty present and no askpass program specified' error?

I'm attempting to compile a few sources utilizing a makefile. In the makefile, there is a lot of commands that should be run as sudo.

At the point when I compile the sources from a terminal all goes fine and the make is stopped the first run through a sudo commands is ran hanging tight for secret word. When I type in the secret word, make continues and finishes.

sudo: no tty present and no askpass program specified


I have looked into the issue on the web and every one of the arrangements I discovered highlight a certain something: disabling the password for this user. Since the user is referred to here is root. I would prefer not.

Is there some other solution?
by

2 Answers

rahul07
Try:

1.Use NOPASSWD line for all commands, I mean:

jenkins ALL=(ALL) NOPASSWD: ALL

2.Put the line after all other lines in the sudoers file.

That worked for me (Ubuntu 14.04).
kshitijrana14
Try:
ssh -t remotehost "sudo <cmd>"

This will remove the above errors.

Login / Signup to Answer the Question.