I encounter a strange Linux cron job permission error on Amazon Linux and can't found related information on the web.
1. First I create a cron job with a regular user [newuser@node1 home]$ crontab -e no crontab for newuser - using an empty one crontab: installing new crontab 2. Then I try to read the cron job file, permission deny [newuser@node1 home]$ cat /var/spool/cron/newuser cat: /var/spool/cron/newuser: Permission denied
It is strange as "newuser" is the owner of that file, why "permission denied" ?
Login as root. [root@node1 home]# cd /var/spool/cron [root@node1 cron]# ls -l -rw------- 1 newuser newuser 47 Aug 3 08:28 newuser [root@node1 cron]# cat /var/spool/cron/newuser 1 1 1 * * /usr/bin/php /tmp/scheduleJob.php [root@node1 spool]# ll -d /var/spool/cron drwx------ 2 root root 4096 Aug 3 08:28 /var/spool/cron