sudo inside a cron job

If some reasons you need to use sudo in a cron job, for example if you use ltib (Linux Target Image Builder)  in a nightly build script, you may realize that it does not work by default and you may get the message:

sudo: sorry, you must have a tty to run sudo

In that case simply run visudo and comment out the line:

#Default requiretty

Support CNX Software - Donate via PayPal or become a Patron on Patreon

Leave a Reply

Notify of