Score:0

Debian 10: user cron does not runl; cron[xxx]: Permission denied

ke flag

all.

Weird errors when trying to run cron on a Deb10 instance. Root is the only user that succeeds in cron. I've tested a simple called to logger and a script that sends an email. No errors running any of the scripts by hand, but just see 2 errors in syslog:

Oct 15 13:38:01 reports cron[8897]: Permission denied
Oct 15 13:38:01 reports CRON[9103]: Permission denied
Oct 15 13:38:01 reports cron[8897]: Permission denied
Oct 15 13:38:01 reports CRON[9102]: Permission denied

8897 is the pid of the main cron process launched by system.

This host was spun up along with 3 or 4 more, all which have no problems with cron. This one was renamed and IP changed recently, but that's the only diff between the others. Both /etc/hosts and /etc/hostname reflect correctly, and even though I don't believe ssl certs are referenced for cron, they're set fine. The same test cron job runs on the others no problems.

Permissions on /var/spool/cron/crontabs is the same among all hosts, as is /var/log.

I cannot for the life of me see just what permission is being denied. I did an strace on the cron process and everything looked fine.

Any ideas on what would prevent user cron and only allow root? This is the biggest clue I have so far.

Sample data

mcarter@reports:~$ crontab -l
# Edit this file to introduce tasks to be run by cron.
# 
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
# 
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
# 
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
# 
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
# 
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# 
# For more information see the manual pages of crontab(5) and cron(8)
# 
# m h  dom mon dow   command
*/1 * * * * /home/mcarter/test.sh >/dev/null 2>&1
mcarter@reports:~$ cat test.sh 
#!/bin/bash
echo Testing | mailx [email protected] -s "Cron test"
logger Cron test
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.