simple priveleges/chmod setup doesn't work

-1

here is the directory listing:

drwxrwSr--. 31 storage storage 4096 Nov 20 23:12 storage

id returns uid=501(peter) gid=501(peter) groups=501(peter),504(office),505(www),506(storage),507(media)

looks ok? but when I try to enter this this I am getting

-bash: cd: storage: Permission denied

What am I doing wrong?

I want to make dir storage accesible (read) for everyone, and writes should be allowed only for users from storage group. Also I want new files to be created with storage group by default

user21886

Posted 2013-11-21T10:24:02.713

Reputation: 353

why downvote??? – user21886 – 2013-11-21T10:51:43.307

Answers

0

Not everybody can read if your directory doesn't have world execute access, so first you need to

$ sudo chmod o+x storage

Furthermore, I don't know what the capital S mode means, never seen it like that, but I think that is where your problem lies; the setuid bit should be a lower case s. if that is the sticky bit, remove it and set it to normal:

$ sudo chmod 0775 storage

(Sudo not necessary if you can log in as storage).

// EDIT To have new files default to storage group, you need to add the setuid bit.

$ sudo chmod g+s storage

Another cause for your problem may be that while id gives you the correct output, your shell isn't updated. If you added yourself to the storage group in this session, make sure to log out and log back in again to make your shell aware of the change.

The Pellmeister

Posted 2013-11-21T10:24:02.713

Reputation: 183

I didn't know about I need execution access to list dir contents – user21886 – 2013-11-21T11:21:47.857

Ah! That's one thing to never forget! To execute a directory means to be able to look what's inside! – The Pellmeister – 2013-11-21T11:27:18.043