4 ms·
One can set up cron jobs under non-root.
by raincom 2y ago
One can set up cron jobs under non-root.
- Ferret7446 2y agoYou cannot edit /etc/crontab without root. I'm not talking about dropping privileges for the job. Although speaking of which, cron dropping privileges is not as secure as systemd running as the user before parsing the user's timers, from a defense-in-depth perspective.
- bigstrat2003 2y agoBut non-root users still have their own crontab, which you don't need sudo to edit.
- Ferret7446 2y agoThat depends on which cron you're using, not all of them support user crontabs (and the ones that do probably have subtle differences in behavior).
- bigstrat2003 2y agoI was unaware of that, so thank you for the education. But for what it's worth, I have never seen a Linux system which didn't have user crontabs. So even if not universal, it is at least very widespread to the point that you can bet on its presence.
- encoderer 2y agoIt’s true that root can disable user crontabs but the cron that’s shipped with all popular Linux distributions does have built-in support for them.
- raincom 2y agoGive me an example of cron, which doesn't support user crontabs? Let me list three that support user crontabs: (a) cronie is controlled by /etc/cron.{allow, deny}; when the latter files are not present, every user can submit cron jobs to crond. (b) One can set up Anacron within the user's home directory[1]. (c) systemd timer is another kid on the block; any user can create a systemd.timer unit. [1] https://opensource.com/article/21/2/linux-automation https://opensource.com/article/21/2/linux-automation