Linux, Why Can't I Write Even Though I Have Group Permissions

Linux, Why can't I write even though I have group permissions?

Did you logout and log back in after making the group changes? See:

Super User answer involving touch permissions failure

In a group with read/write/execute permissions in a folder but cannot cd into it

Unix permissions actually work this way:

if (you are root) {
you have 'rwx' permissions for any folder and 'rw' and possibly 'x' for any file
} else if (you are file's owner) {
only 'owner' permissions apply to you
} else if (list of groups you belong to includes file's group) {
only 'group' permissions apply to you
} else {
only 'other' permissions apply to you
}

So if you are user1 and folder's owner is user1 and folder has '---rwx---' permissions, then owner permissions ('---') apply to you and you have no access.

Members of group can't access directory in linux

Directories require executable access to enter/see contents. So if you wanted a group to have access privileges to a directory chmod -R 775 assignment/ should work.

Can't write in a folder with permissions

For the new group to take effect, you must log out and log in again (opening a new shell is not sufficient)

@n.m. (originally a comment to this question)

Permission issues: can't write to directory owned by certain group

Apparently one needs to restart the session after being added to a group.

Debian/Linux Group permissions are not working as they are supposed to

Here is how I solved it:

First of all I read this:
link
At some point this article mentioned file /etc/group whe information about groups is stored.

I opened this file and mentioned that inspite of my previous actions there is no www-data in group boinc. And no www-data in group boincadm and the opposite. That is strange!
Strange because I've added these users to group boinc using usermod command and made sure this group is primary for both.
Moreover command groups <username> showed that they are in group boinc.

So now the question is: Why this happened?

The problem was solved by modifying 3 lines:

boinc:x:1111:boincadm, www-data
boincadm:x:1112:boincadm, www-data
www-data:x:1113:www-data, boincadm

I needed all 3 lines to make it work. Hope it helps somebody. And I still would like to understand why the file /etc/group was not modified automatically when using usermod. And why grops shows correct result if so.



Related Topics



Leave a reply



Submit