[sudo-users] sudo in crontab

Huibert.Kivits at mail.ing.nl Huibert.Kivits at mail.ing.nl
Wed May 18 12:32:50 EDT 2005

Hi Tran-Huu,

We experienced something similar on Solaris systems. Not on AIX, BTW.

The error message might not be related to sudo itself. But to cron.

AFAIK, if you create a crontab for a user on a Solaris systems, a message will be sent to console when the cronjob is invoked. The user must have rights to write to console.
On a Solaris system, you can add the user to the group tty.
Alternatively, you redirect the message to a file. Something like this:

1 1 * *  0  /opt/bin/sudo  XXX.sh  >/dev/null 2>/dev/null

Met vriendelijke groeten / With kind regards / Mit freundlichen Grüßen / Med vänliga hälsningar / nuosirdziausi linkejimai,

Huibert Kivits

"...all too often, when organizations develop information security programs, they treat security issues as a simple 'check-box' on the list of required corporate functions."
Richard Forno & Kenneth R van Wyk, "Incident Response", O'Reilly, 2001, ISBN: 0-596-00130-4

-----Oorspronkelijk bericht-----
Van: sudo-users-bounces at courtesan.com [mailto:sudo-users-bounces at courtesan.com] Namens Tran-Huu.Hanh at t-systems.com
Verzonden: woensdag 18 mei 2005 18:10
Aan: sudo-users at sudo.ws
Onderwerp: [sudo-users] sudo in crontab

Hi all,


from the command prompt i can run a script with sudo.


 $ /opt/bin/sudo  XXX.sh


if I put this script with sudo - the same syntax -  in a crontab, it doesn't work


1 1 * *  0  /opt/bin/sudo  XXX.sh


In log I see: "you must have a tty to run sudo ... "


How can I fixe the problem?


Thanks for your help


T.H. Hanh

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

The information in this electronic mail message is private and
confidential, and only intended for the addressee. Should you
receive this message by mistake, you are hereby notified that
any disclosure, reproduction, distribution or use of this
message is strictly prohibited. Please inform the sender by
reply transmission and delete the message without copying or
opening it.

Messages and attachments are scanned for all viruses known.
If this message contains password-protected attachments, the
files have NOT been scanned for viruses by the ING mail domain.
Always scan attachments before opening them.

More information about the sudo-users mailing list