When a cron job runs with what privilege does it execute?
I'm not sure about that. Is it with the same privileges of the user that added it via crontab -e
?
cronpermissions
When a cron job runs with what privilege does it execute?
I'm not sure about that. Is it with the same privileges of the user that added it via crontab -e
?
Best Answer
You can specify a user in the system crontab entries like so:
The 6th argument can be a username. Additionally you can put scripts in the
/etc/cron.d
directory. The scripts take the same form as the crontab entries described above, for example:You can put scripts in these directories, but they're meant to be run as root:
Finally you can create user based crontab entries by running this command as a given user:
These entries are stored in files with the same name as the user in this directory,
/var/spool/cron/
: