I need to run a nightly job that requires the root password. I am considering either adding the command to run this job to root's crontab or using sudo to run the job as another user. What are the pros and cons of each of these solutions? Thank you.
I can see no great advantage to the sudo method unless you want to give someone else the right to reschedule or disable the job without giving them root access.
Thank you, Annihilannic. I was wondering - are there any inherent security risks associated with using sudo? I should have explained that I have access to both root and the administrative user that I am thinking of using to run the cron job. I was wondering - at a system level - what the appropriate solution would be.
One security risk of having a user run a script using sudo. If the user has permissions to modify the script, then they would be able to run any command in that script as root.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.