cancel
Showing results for 
Search instead for 
Did you mean: 

cron job permssion denied

prasanth.ps
Frequent Advisor

cron job permssion denied

Hi all,

Avance thanx....

I have a problem in the RHEL 4 server.Am not able to run the crontab -l if am running through a normal user." root" user its working fine without any problem. If am running the above command as a normal user its showing "permission denied" to excecute.

Please help me to solve it out.

Thanx again.

Rgds,

Prasanth.
7 REPLIES
~sesh
Esteemed Contributor

Re: cron job permssion denied

To run a (only) command with root privileges you can run sudo at the prompt.
prasanth.ps
Frequent Advisor

Re: cron job permssion denied

hi,

r u telling that crontab will not run in normal user without using the sudo?

But am able to run the "crontab" command in some other machine as a normal user.

rgds,

prasanth
Stuart Browne
Honored Contributor

Re: cron job permssion denied

It's probably a permissions issue on crontab binary.

Generally, you'll have the following:

/var/spool/cron - ower root:root with permissions 0700 (drwx------).
/usr/sbin/crontab - ower root:root with permissions 4755 (-rwsr-xr-x).

The 'crontab' binary is set up as 'suid', so it should run as any user.

If at some point the crontab binary had it's permissions changed (use 'rpm -V vixie-cron' to confirm that), it will cause this issue.

If this is all it is, then 'chmod 4755 /usr/bin/crontab' will fix it.

If it's not that, then show us the output of the following two commands:

/bin/ls -ld /var/spool/cron /usr/bin/crontab
/bin/rpm -V vixie-cron

One long-haired git at your service...
~sesh
Esteemed Contributor

Re: cron job permssion denied

No, my point is not that crontab cannot be run by user with normal user privileges.

My intent was to imply that in case the (a) command isn't executing as expected, the command can be easily run with higher privileges just by preceding the command with sudo.
prasanth.ps
Frequent Advisor

Re: cron job permssion denied

Thanx sturat,

Its the binary problem after setting sid to the crontab file its working fine.


Thanx and rgds,

Prasanth
prasanth.ps
Frequent Advisor

Re: cron job permssion denied

Now am closingthis thread.
Sitarama.H.N
Advisor

Re: cron job permssion denied

Check the permissio for the user in the cronjob, by default the user will be having read only permission.
Change the permission of user to execute in cronjob and try once again.