Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Are there any 'gotcha' permission issues that newbie sys admins might not take into consideration.

Basically what I am looking for, is experienced linux admins to share some permission 'mishaps' that newbie admins might overlook.

(I am a linux newbie, just read over file ownership and permissions, and what to get some real life stores of when things go wrong')

share|improve this question
    
Of course there is the obvious point. Setup and test your backup system before you start exploring things you don't know how to reverse. –  Zoredache Dec 13 '09 at 1:37
add comment

3 Answers

Don't use chown -R unless you're really, really sure you know what you're doing.

I was once at a place where the sysadmin (not me, I was a programmer) decided to do a "chown -R" on our source directory tree (this was back in the days of SCCS, so everybody looked at the same directory) and managed to chown the SCCS directories, making it so nobody could check anything out or in.

share|improve this answer
add comment

It's important to know that if you want people to be able access a directory, the execute bit must be set on all of the parent directories for that particular user. For instance:

user1@host$ mkdir -p one/two
user1@host$ echo "hi" > one/two/readme
user1@host$ chmod 700 one
user1@host$ su user2
user2@host$ cd one/two
bash: cd: one/two: Permission denied
user2@host$ ls -al one/two/readme
ls: cannot access one/two/readme: Permission denied
user2@host$  cat one/two/readme
cat: one/two/readme: Permission denied
user2@host$ exit
user1@host$ chmod +x one
user1@host$ su user2
user2@host$ cat one/two/readme
hi

This mostly comes into play in things like web servers, where a user will want to present files to the populace in general (typically in ~/public_html for instance) but wants to keep the parent directory secure. There is no need or reason to set the read bit, unless you want your user to be able to execute a directory listing.

share|improve this answer
add comment

As a general rule, don't make files or directories world-writable. (temporary directories count as an exception, but be sure to set the "sticky" bit.)

Removing the executable permissions from the dynamic linker (/lib/ld*.so) is a "fun" way to shoot yourself in the foot.

share|improve this answer
add comment

Your Answer

 
discard

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.