Cron scripts security


 
Thread Tools Search this Thread
Operating Systems AIX Cron scripts security
# 1  
Old 09-02-2013
Cron scripts security

Hello everyone,

I have an AIX 6.1 machine and i experienced a problem with my cron scripts. It appears that somebody renamed a cron script so crontab could not execute it.
Is there a way to put some security on cron scripts so nobody else except root can rename or delete a cron script? Or they are treated the same way with other files (access rights)?

Thank you
# 2  
Old 09-02-2013
Hello,

In case of AIX you can decide either a particular user should have access or not to crontab, so for that you can edit file named

Code:
  /var/adm/cron/cron.deny

or
Code:
 /var/adm/cron/cron.allow

As by name itself we can can understand that allow file will allow users, deny file will deny users.


By this you can manage the users to access the crontab entries.


Thanks,
R. Singh
# 3  
Old 09-02-2013
Do I understand right, that the name of a script called by cron was changed?
The easiest way to protect them from renaming is to put all scripts called by cron into a directory owned by root and only give root any rights on that directory.
# 4  
Old 09-02-2013
well actually this is useful to have a list of users who can access the crontab but this is not my case.
the user who renamed the cron script didnt have access to the crontab. he just went to the directory that the cron script is located and renamed it.
i was wondering if there was any "special" way to handle access rights on cron scripts or if they are treated the same way with other scripts.
i guess that i should give specific access rights to root only or to the user that runs the cron scripts.
# 5  
Old 09-02-2013
They are normal scripts - file access rights and directory permissions (file deletion!) apply.
# 6  
Old 09-02-2013
As MadeInGermany stated, regular access controls apply.

So, simple ways to protect directory is to 1) remove write permission to directory and/or add STVX (chmod g-w,o+t .../directoryname) to the directory.

The script itself would be protected using the group/other write bits (chmod og-w .../filename)
# 7  
Old 09-03-2013
ok thank you very much for your help and tips
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to get cron (scripts in crontab) started?

Hi, I have a query related to UNIX Crontab scripts - Issue: Server space on the db server got 100% full as a result of which the cron scripts did not run. The space utilization issue got resolved in the afternoon. The crons scheduled for a time post the resolution caught up. However the... (1 Reply)
Discussion started by: qwerty000
1 Replies

2. Solaris

running scripts from cron

I need to run a script (from cron) that runs a second script. What worries me is that second script, when run from bash, upon finishing doesn't return to bash unless I press the 'Enter' key. I presume that's because last command in that script ends with & Could that be a problem for cron?... (2 Replies)
Discussion started by: orange47
2 Replies

3. Shell Programming and Scripting

Linux - scripts not working in cron

hi all, i have scripts executable in manully, but not working in cron. any ideas? thanks a lot? * * * * * /home/dir/dir/file.sh #! /bin/sh alarmPath="/home/dir/monitoringAlarm" alarmDateTime="$(date +%Y%m%d) $(date +%H%M%S)" tomcatPID=`pidof /usr/local/jdk1.6.0_13/bin/java` echo "tomcat... (3 Replies)
Discussion started by: maxlee24
3 Replies

4. Red Hat

Linux - scripts not working in cron

hi all, i have scripts executable in manully, but not working in cron. any ideas? thanks a lot? * * * * * /home/dir/dir/file.sh #! /bin/sh alarmPath="/home/dir/monitoringAlarm" alarmDateTime="$(date +%Y%m%d) $(date +%H%M%S)" tomcatPID=`pidof /usr/local/jdk1.6.0_13/bin/java` echo "tomcat... (1 Reply)
Discussion started by: maxlee24
1 Replies

5. Shell Programming and Scripting

Problem with ftp scripts and cron

Need some help / advice with the follow script... Basically i have an FTP server that connects to other ftp servers and sends and downloads files every few hours or so. There are 12 different accounts that all have 2 scripts each, one to send and one to receive. Below is an example send script... (1 Reply)
Discussion started by: mokachoka
1 Replies

6. Shell Programming and Scripting

Cron and multiple scripts problem.

Hello All, I have 3 scripts namingly 1X 2X and 3X. I have one directory ABC created which contains some 40 sub directories. I have one input file in the below format.The input file resides in ABC directory. Inputfile format; subdirectoryname date subdirectoryname1 date subdirectoryname2... (1 Reply)
Discussion started by: RSC1985
1 Replies

7. Shell Programming and Scripting

Running 2 scripts one after the other using cron

I would like to run two scripts using cron one immediately after the other. Is it enough to put them one after another in the cron file to run at the same time, or will this cause them to run concurrently? (4 Replies)
Discussion started by: 3210
4 Replies

8. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

9. Shell Programming and Scripting

help in cron scripts

Hi, i have scheduled my scripts in cron, some time the script doesn't runs ..which will impact me a lot, can some one help me such that mail has to come stating script has run successfully/unsuccessful any help will be appreciated.. thanks in advance, geeko (0 Replies)
Discussion started by: geeko
0 Replies

10. UNIX for Dummies Questions & Answers

Cron running shell scripts.

What are the rules of calling shell scripts in cron. How do I go about setting up the correct PATHS that calls a script, which then calls another sub script all of which has to retain the orginal PATHS and VARS that I've set up in first script Confused.. ok Well Cron calls a script... (3 Replies)
Discussion started by: cfoxwell
3 Replies
Login or Register to Ask a Question