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

Gonzalez, Aliep aliep.gonzalez at rbc.com
Wed Nov 2 15:05:54 EDT 2011

After adding the backslashes as per Todd's suggestion the issue went

Thanks very much Todd for your help.

-----Original Message-----
From: Todd C. Miller [mailto:Todd.Miller at courtesan.com] 
Sent: 2011, November, 02 10:31 AM
To: Gonzalez, Aliep
Cc: sudo-users at sudo.ws
Subject: Re: [sudo-users] no tty present and no askpass program

>From the error message you are receiving, sudo is trying to read a
password but this is a non-interactive session.  You may want to use
sudo's -n (non-interactive) option which will at least give you a more
useful error message.

The root of the problem is likely the sudoers entry for uyqn0001.
The way that whitespace is handled in sudoers commands has changed so it
is possible that you simply need to add some backslashes to quote the
spaces in the command.  Perhaps something like:

uyqn0001 ALL = NOPASSWD: /bin/su - dspace -c cd\
/u/app/dspace/batch/feeds/monaco\ ;\ ./MonacoTradeInactiveDataCleanup.sh

That would allow uyqn0001 to run:

sudo /bin/su - dspace -c "cd /u/app/dspace/batch/feeds/monaco ;

>From the log entry you posted you may need an extra (non-quoted) space
after the -c.

 - todd

This email may be privileged and/or confidential, and the
sender does not waive any related rights and obligations.
Any distribution, use or copying of this email or the
information it contains by other than an intended recipient
is unauthorized. If you received this email in error,
please advise the sender (by return email or otherwise)
immediately. You have consented to receive the attached
electronically at the above-noted email address; please retain a
copy of this confirmation for future reference.

Ce courriel est confidentiel et protégé. L'expéditeur ne renonce
pas aux droits et obligations qui s'y rapportent. Toute diffusion,
utilisation ou copie de ce courriel ou des renseignements qu'il
contient par une personne autre que le (les) destinataire(s)
désigné(s) est interdite. Si vous recevez ce courriel par erreur,
veuillez en aviser l’expéditeur immédiatement, par retour de courriel
ou par un autre moyen. Vous avez accepté de recevoir le(s) document(s)
ci-joint(s) par voie électronique à l’adresse courriel indiquée ci-dessus;
veuillez conserver une copie de cette confirmation pour les fins de reference future.

More information about the sudo-users mailing list