Linux, Why can not I write, although I have group permissions?

I want to create a file in a directory that belongs to the staff group of which I am a member. Why can't I do this?

bmccann@bmccann-htpc:~$ ls -l /usr/local/lib/R/ total 4 drwxrwsr-x 2 root staff 4096 2010-07-31 16:21 site-library bmccann@bmccann-htpc:~$ id -nG bmccann bmccann adm dialout cdrom plugdev staff lpadmin admin sambashare bmccann@bmccann-htpc:~$ touch /usr/local/lib/R/site-library/tmp touch: cannot touch `/usr/local/lib/R/site-library/tmp': Permission denied 
+81
linux file-permissions permissions
Feb 20 2018-11-11T00:
source share
5 answers

Did you log out and log in after making changes to the group? Cm:
Superuser response related to touch permission denial

+161
Feb 20 2018-11-11T00:
source share

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.

+10
Nov 18 '13 at 22:57
source share

I had a problem when the user could not access the /foo/bar/baz directory, even if he had permissions because he did not have access to the bar directory.

+4
Mar 27 '14 at 12:37
source share

Use Linux ACLs (access control lists) is a smaller version of the permission system,

 setfacl -R -m 'group:staff:rwx' -m 'd:group:staff:rwx' /usr/local/lib/R/ 

This sets up both active rights for the directory and default rights for everything created inside.

This does not work without relogin if you just added yourself to the staff group, but you can only set permission for yourself for the current session.

+4
Sep 17 '14 at 17:53
source share

I had the same problem, check if there are more ACL rules in the folder or not!

If you see a list of + (plus) when you specify a folder, it means that it has special access rules. For example:

 [user_in_apache_group@web02 html]$ ls -l total 16 drwxrwxr-x 16 apache apache 4096 Sep 4 13:46 ilias drwxrwxr-x+ 15 apache apache 4096 Sep 4 13:46 ilias5 

View Resolution:

 [user_in_apache_group@web02 html] getfacl ilias5 # file: ilias5 # owner: apache # group: apache user::rwx user:user_in_apache_group:rx group::rwx mask::rwx other::rx 

Thus, my user (user_in_apache_group) does not have write permission for this folder.

The solution is what @techtonik said, adding write permission for the user:

 [user_in_apache_group@web02 html]$ sudo setfacl -mu:user_in_apache_group:rwx ./ilias5 

Check permission again:

 [user_in_apache_group@web02 html] getfacl ilias5 ... user:user_in_apache_group:rwx ... 

Hope this helps;)

+2
Sep 04 '15 at 12:18
source share



All Articles