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

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK Pi 4C Plus
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
0 Comments
Khadas VIM4 SBC