Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was just wondering, is using a cron job that is group readable a security risk? In this case, the script is chmod 755, and the group is basically a group of the sysadmins on the machine. The permissions seem to be fine, but I'm just wondering whether it's a bad idea to keep this script in a group or world readable place because it's a backup script that needs to be run as root. Thanks!

share|improve this question
Sysadmin Mantra: Security is a matter of trust! – The Unix Janitor Mar 22 '10 at 11:03
Yeah, I guess you're right. This is kind of a silly question. – Ibrahim Mar 22 '10 at 17:18
up vote 2 down vote accepted

The only real security risk I can think of off the top of my head is that if there is a security hole in the script, it can potentially be found by anyone just by reading the script.

However, if the script must be run as root, why do the group and user also have the executable bit set? IMO, the "correct" permissions for the file would be 740, not 755 (so that the sysadmin group can read the file w/o sudo)

share|improve this answer
Hmm, OK. That makes sense. My question was kind of silly I guess. – Ibrahim Mar 22 '10 at 17:16

That depends on what the script is. If the script contains passwords or other sensitive data then yes it probably is, otherwise, not so much.

Would you post the script on your office noticeboard? Would you post it on this website? If yes then it's fine for it to be readable by anyone, otherwise you should consider changing the permissions.

share|improve this answer
Yeah, I guess you're right. It doesn't have any passwords because root is set up with a .pgpass file that will allow root to access the postgress databases without authenticating. It just seemed a little weird to me but I guess there's no problem with it. – Ibrahim Mar 22 '10 at 17:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.