1829403 Members
1760 Online
109991 Solutions
New Discussion

Unable to use cron

 
SOLVED
Go to solution
Sanjiv Sharma_1
Honored Contributor

Unable to use cron

Hi,

I have a user tiger.

After login as user tiger I give the command
$ crontab -l
It gives message ::
crontab: you are not authorized to use cron. Sorry.

I have made an entry for the user tiger in /var/adm/cron/cron.allow, but still I am getting the same error.

I want to add some cronjobs for this user.
How can I do it?

Thanks,
Raje.
Everything is possible
7 REPLIES 7
S.K. Chan
Honored Contributor
Solution

Re: Unable to use cron

Did you restart the cron daemon ?

# ps -ef|grep cron
# kill
# /usr/sbin/cron
Tom Geudens
Honored Contributor

Re: Unable to use cron

Hi,
Just checking ... the error message is the SAME after you add tiger in /var/adm/cron/cron.allow ? It would be normal to get the following message ...
$crontab -l
crontab: can't open your crontab file.
... because tiger doesn't have any jobs yet.

Does tiger have an actual account on the system ? Can you post the output (blank out the encrypted password if the system is not trusted) from
$cat /etc/passwd | grep "tiger"

Regards,
Tom Geudens
A life ? Cool ! Where can I download one of those from ?
S.K. Chan
Honored Contributor

Re: Unable to use cron

Ok try this also .. login to the system as user "tiger".

$ vi cron-file
==> put our cron entries in this file.
$ crontab cron-file
==> this should copy the cron file to /var/spool/cron/crontabs/tiger
$ crontab -l
==> check it ..
Sanjiv Sharma_1
Honored Contributor

Re: Unable to use cron

Hi Chan,
I have restarted the cron but still the same message.
I have also tried to create a cronfile and execute it with
$ crontab cron-file but it gives the same message
"crontab: you are not authorized to use cron. Sorry.

Hi Tom,
I am not getting the error mentioned by you.

Yes. tiger is an actual account.

Cron is working for the other users but not for tiger.

Thanks,
Raje.
Everything is possible
Deepak Extross
Honored Contributor

Re: Unable to use cron

Hi Raje,

Check that the crontabs files for 'tiger' is owned by
'tiger' and that 'tiger' has write access on it.
ll /var/spool/cron/crontabs/tiger

Also, ensure that there is no entry for 'tiger' in cron.deny file.

HTH
SHABU KHAN
Trusted Contributor

Re: Unable to use cron

Raje,

This is really a strange problem ... hmm...

Did you do the following:

1) Check if user tiger is a valid user (as mentioned earlier)

grep tiger /etc/passwd

2) set the user tiger's profile environment variable
EDITOR=/usr/bin/vi

3) Add user "tiger" to the cron.allow file

4) Kill -HUP

I think cron.allow takes precedence over cron.deny even if you have user tiger in cron.deny

Let us know if you still have a problem...

Thanks,
Shabu


Darrell Allen
Honored Contributor

Re: Unable to use cron

Hi Raje,

tiger must be listed in /var/adm/cron/cron.allow and must not be in /var/adm/cron/cron.deny.

I presume /usr/lib/cron is a symlink pointing to /var/adm/cron since you say other users can use cron.

Does tiger have the same numeric UID as another user? If so and if that user is listed in /etc/passwd before tiger, then that's the loginid that cron will verify is allowed to use cron even if logged in as tiger.

For example, assume the following are from /etc/passwd:

lion:ekdi4jgvld89k:9001:20::/home/lion:/usr/bin/sh
tiger:adfwajklffdw:9001:20::/home/tiger:/usr/bin/sh

tiger has the same uid (9001) as lion. Placing tiger in cron.allow will have no effect because cron will see the uids are the same and will check for the name lion.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)