Bug 350 - "no tty present and no askpass program specified" error on sudo w/ssh
"no tty present and no askpass program specified" error on sudo w/ssh
Status: RESOLVED INVALID
Product: Sudo
Classification: Unclassified
Component: Sudo
1.7.1
PC Linux
: low low
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-29 11:11 MDT by sean_swift
Modified: 2009-04-29 11:19 MDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sean_swift 2009-04-29 11:11:04 MDT
Target system is running CentOS5 install with 2.6.29 custom kernel upgrade with the latest sudo ( 1.7.1 ).

When we attempt to ssh from remote systems and do a task via sudo, we get the following error message:

    "no tty present and no askpass program specified"

On previous systems installed with 1.6.7 and 1.6.8 it doesn't do this.

In check.c:119 is where the error check is done.  I added code to print out the values of the display variable (user_display) and the tty, and it's clear that no display variable is set, yet we fall through this condition to the error.

Any questions, please let me know.

Sean
Comment 1 Todd C. Miller 2009-04-29 11:19:36 MDT
From the TROUBLESHOOTING file.

Q) When I try to run sudo via ssh, I get the error:
    sudo: no tty present and no askpass program specified

A) ssh does not allocate a tty by default when running a remote command.
   Without a tty, sudo cannot disable echo when prompting for a password.
   You can use ssh's "-t" option to force it to allocate a tty.
   Alternately, if you do not mind your password being echoed to the
   screen, you can use the "visiblepw" sudoers option to allow this.

   E.g.
     Defaults visiblepw