Why can't a Linux user edit files in the group he is a member of?
I am using Ubuntu 12.04 and have the same problem when a user cannot write to a file to which he is allowed group access. For example:
whoami //I am user el el touch /foobar/test_file //make a new file sudo chown root:www-data /foobar/test_file //User=root group=www-data sudo chmod 474 /foobar/test_file //owner and others get only read, //group gets rwx sudo groupadd www-data //create group called www-data groups //take a look at the groups and see www-data //www-data exists. groups el //see that el is part of www-data el : www-data
Restart the terminal to ensure that users and groups take effect. Login as email.
vi /foobar/test_file //try to edit the file.
It gives a warning:
Warning: W10: Warning: Changing a readonly file"
What? I did everything right, why is it not working?
Answer:
Do a full reboot of the computer. Stopping the terminal is not enough to fix these problems.
I think that it happens that apache2 also uses the www-data group, so the task somehow interfered with the proper execution of users and groups. You need to not only log out, but also stop and restart the services that use your group. If the reboot does not receive it, you are having big problems.
Eric Leschinski Nov 18 '13 at 22:57 2013-11-18 22:57
source share