I added this rule to the bottom of my crontab
* * * * * /root/test.sh
It basically resets iptables so I can fool around. If I mess up I won't be locked out of my box. When I run the script in bash writing
/root/test.sh it clears everything as expected. However if I wait a minute it doesn't seem to execute.
I ran the command below and can see every minute it appears to run my script but my script isn't doing anything.
grep CRON /var/log/syslog
IIRC the way to force a script to run as the owner is
chmod a+s file. So I did that.
stat shows this line
Access: (6755/-rwsr-sr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Shouldn't cron be running my script as root? Why doesn't it seem to be executing? I am running debian 7 (wheezy)