Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question already has an answer here:

I am user tim, in the bob group, and I have a file with unusual permissions:

$ whoami
tim
$ groups
lp wheel cron audio cdrom video bob tim
$ ls -l foo
--w--w-r--  1 bob bob   10 Feb 15 18:43 foo

Since the file foo is world readable, I should be able to read the file, but I can't.

$ cat foo
cat: foo: Permission denied

Is it possible for me to read the file as user tim? Steve can and I'm jealous...

$ whoami
steve
$ cat foo
secret!

I apologize for the bad title. I'm having a hard time succinctly describing the problem.

share|improve this question

marked as duplicate by terdon, sawdust, ChrisF, Dennis, Dave M Feb 16 '13 at 17:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

up vote 2 down vote accepted

In Unix, the permissions are checked strictly in this order: If the user is the owner of the file, the owner permissions apply. If the user isn't the owner, but belongs to the file's group, group permissions apply. If the user isn't the owner or belongs to the group of the file, the other permissions apply. As a special case, root is allowed to do whatever she wants.

share|improve this answer
    
Thanks, this was the explanation I was looking for. –  Tim M Feb 16 '13 at 16:29

The problem is that you have explicitly set the file to not be readable by members of the group 'bob' and tim is a member of bob.

You need to either remove tim from the bob group, or set the group of the file to something tim is not a member of.

share|improve this answer
    
Or make the file group readable, which is probably most likely what you want. What sense does it make to make a file world readable and not group readable? (And the only choices are for that to do nothing or for that to prevent people in the group from reading. If you don't want it to prevent, why set it?) –  David Schwartz Feb 16 '13 at 2:08

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