1834138 Members
2007 Online
110064 Solutions
New Discussion

Re: crontab problem

 
O'lnes
Regular Advisor

crontab problem

I have allow a user to process the crontab job , but each time after the user make the modification of the cron ( crontab -e) , then the file access mode will be change to 400 automatically, can suggest how to solve? Thx.

eg.

before change

-r--r--r-- 1 usera usr 1396 Oct 28 11:54 usera

after change

-r???------ 1 usera usr 1396 Oct 28 11:54 usera
Andy
10 REPLIES 10
Michael Tully
Honored Contributor

Re: crontab problem


By default when a cron file is created or modified by submission, (crontab -e, crontab filename) the file has its ownership as user name primary group name. The permissions by default are created as 400.

I am not sure why you want all users to view any crontab file other than their own.
Anyone for a Mutiny ?
O'lnes
Regular Advisor

Re: crontab problem

hi Michael Tully,

cos we only allow one user to modify the cronjob and this is a share a/c , so a group of member need to read it, can suggest how to solve it?
Andy
V. V. Ravi Kumar_1
Respected Contributor

Re: crontab problem

hi,
the default file permissions on crontabs are 400 only. no need to change, they should be readable only by owner.

regds
Never Say No
T G Manikandan
Honored Contributor

Re: crontab problem

By default the files have the permissions 400.
There is no need to change them
I am not sure how did you have 444 before the change.

400 are the right permissions

Thanks
O'lnes
Regular Advisor

Re: crontab problem

hi all,

It is useful to set the permission as 444 after modification , can suggest how to solve it? Thx.
Andy
Patrick Chim
Trusted Contributor

Re: crontab problem

Hi,

You said the owner is a shared account so every one using this account can view the cronjob file, right ?

If you really want to set the permission to 444, I think you should write a script executed by root to change it every 1 minute or longer !

Regards,
Patrick
Michael Tully
Honored Contributor

Re: crontab problem

There are two solutions:

First is to run a script from cron that changes the ownership of the crontab files regularly, but not every minute, 10 minutes should be sufficient. The second would be to utilise the shared account from a tool such as 'sudo' so that the crontab file could be read by the individuals required.
Anyone for a Mutiny ?
Ronald Cogen
Frequent Advisor

Re: crontab problem

Hello,

Two files are used to allow/deny access to the cron daemon for ordinary system users. these files are /var/adm/cron/cron.allow and /var/adm/cron/cron.deny. If neither of these files are present, only root can access cron. If both of these files are present, the precedence goes to the cron.allow file. All users listed in this file are allowed to use cron. If cron.allow exists but is empty, only root can use cron. If only corn.deny exists, all users except those listed in this file are allowed to use cron.

Take note that when cron.allow does not exist and cron.deny exists but is empty, then all users of the system have access to cron.

Ron
I've been down so long it looks like up to me
O'lnes
Regular Advisor

Re: crontab problem

Thx all reply , I think some respondents are confused, What I want is just to let all developer to read the file "/usr/spool/cron/crontabs/crontab" after the job owner modify the cron , not let all users to modify the cron (crontab -e). Thx.
Andy
harry d brown jr
Honored Contributor

Re: crontab problem

Andy,

Just how disrespectful and ungrateful can you be? IN SIX MONTHS? YOU have got to be KIDDING ME!

This member has assigned points to 190 of 474 responses to his/her questions.

Read this:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x376efd3f91d3d5118ff40090279cd0f9,00.html

then find your previous questions here:

http://forums.itrc.hp.com/cm/TopSolutions/1,,CA759973!1!questions,00.html


live free or die
harry
Live Free or Die