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.

I'm using Ubuntu 10.10 64-bit and have created a group 'dcc' to which I added myself as user 'ralc'. After logging out and back in again I tried the command 'groups' and it gives me the line:

ralc adm ... dcc 

(some groups omitted)

I then created a directory 'dccdir', used chmod g=rwx dccdir; chmod u= dccdir and changed the directory group with chgrp dcc dccdir. The result from ls -l | grep dcc is as follows:

d---rwxr-x  2 ralc dcc 4096 2011-04-26 18:56 dccdir

Now for the real question: seeing that I'm in the same group as the directory, I would assume that I should be able to access and list the contents of the directory. However, when doing ls dccdir I get the message:

bash: cd: dccdir/: Permission denied

Can you explain where I'm mistaken?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Since you own the directory, only the "owner" permission bits are applied. "Group" and "world" permissions are ignored.

Quote manual page path_resolution(7):

Permissions

The permission bits of a file consist of three groups of three bits, cf. chmod(1) and stat(2). The first group of three is used when the effective user ID of the calling process equals the owner ID of the file. The second group of three is used when the group ID of the file either equals the effective group ID of the calling process, or is one of the supplementary group IDs of the calling process (as set by setgroups(2)). When neither holds, the third group is used.

share|improve this answer
    
That makes perfect sense. Thanks! –  Ralc Apr 26 '11 at 22:57

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.