Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crontab and sudo vs. root's crontab 1

Status
Not open for further replies.

robynne

Programmer
Aug 11, 2001
5
0
0
US
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.

Annihilannic.
 
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.

Thanks again,
Robin
 
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.

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top