I can't write to a folder which I'm a member of

Posted by user3265472 on Super User See other posts from Super User or by user3265472
Published on 2014-05-31T08:11:33Z Indexed on 2014/05/31 9:33 UTC
Read the original article Hit count: 195

Filed under:
|

I'm trying to setup folder access to a group so that all members of that group can create/edit/delete files within the folder.

# create my group and add a member
sudo addgroup dev
sudo adduser martyn dev

Now, logged in as "martyn", check my user has been added to "dev" group

groups martyn
martyn : martyn dev

Now I want to change the group ownership of my project folder so all members of that group can edit it and files/folders within it.

sudo chgrp -R dev myproject

Just to check:

martyn@localhost:/var/www$ ls -l
total 4
drwxrwxr-x 3 dev dev 4096 May 31 15:53 myproject

Now here's where it fails. I want to create a file within myproject (logged in as "martyn", a member of "dev"):

vi myproject/test

..but when I try to save the file I get the following error:

"myproject/test" E212: Can't open file for writing

Why, as user "martyn" which is a member of "dev", can I not write this file? Even if I create the file so it exists, change the ownership to "dev" then try to edit and save - I get the same error.

© Super User or respective owner

Related posts about linux

Related posts about permissions