[sudo-users] sudo: no tty present and no askpass program specified

Tony G. tonysk8 at gmx.net
Thu Feb 25 18:54:41 EST 2010

The errors say it all: sudo: no tty present and no askpass program specified

Look at your sudoers probably it has:
Defaults    requiretty

>From the sudoers man

If set, *sudo* will only run when the user is logged in to a real tty. When
this flag is set, *sudo* can only be run from a login session and not via
other means such as *cron(8)* or cgi-bin scripts. This flag is *off* by
I've never used askpass, man says:

The *askpass* option specifies the fully qualified path to a helper program
used to read the user's password when no terminal is available. This may be
the case when *sudo* is executed from a graphical (as opposed to text-based)
application. The program specified by *askpass* should display the argument
passed to it as the prompt and write the user's password to the standard
output. The value of *askpass* may be overridden by the
SUDO_ASKPASSenvironment variable.
Give it a try commenting out the requiretty.

On Thu, Feb 25, 2010 at 1:21 PM, Josef Wolf <jw at raven.inka.de> wrote:

> Hello,
> On ubuntu-9.10 with sudo-1.7.0, I have put the following line into my
> sudoers
> file on server.my.domain:
>  naclt ALL = NOPASSWD: /usr/local/bin/naclient
> to allow execution of this program as root from remote hosts. So from the
> remote host, I do
>  /usr/bin/ssh -i /home/me/.ssh/naclt-dsa \
>              -o "ServerAliveInterval 60" \
>              -o "ServerAliveCountMax 3" \
>              naclt at server.my.domain \
>              /usr/bin/sudo /usr/local/bin/naclient version
> But sudo errors out:
>  sudo: no tty present and no askpass program specified
> Why is sudo trying to ask a password here? Did it not get the NOPASSWD
> option?
> This used to work perfectly fine with sudo-1.6.9.p17 and exactly the same
> sudoers file on ubuntu-9.04.
> Any ideas? Any workarounds?
> ____________________________________________________________
> sudo-users mailing list <sudo-users at sudo.ws>
> For list information, options, or to unsubscribe, visit:
> http://www.sudo.ws/mailman/listinfo/sudo-users


More information about the sudo-users mailing list