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
How to Take Ownership of a Hid Device
Bash: /Bin/Tar: Argument List Too Long When Compressing Many Files with Tar
Choosing Between Multiple Executables with Same Name in Linux
How to Do the Opposite of Diff
When a Parent Process Is Killed by "Kill -9", Will Subprocess Also Be Killed
Are There Any Good Postgresql Clients for Linux
How to Check If a Service That I Don't Know the Name of Is Running on Ubuntu
How to Convert Pe(Portable Executable) Format to Elf in Linux
How to Develop Linux Screen Saver
How to Fetch Java Version Using Single Line Command in Linux
Ps Utility in Linux (Procps), How to Check Which CPU Is Used
Why Would It Be Impossible to Fully Statically Link an Application
Git Forces Refresh Index After Switching Between Windows and Linux
How to Test for If Two Files Exist
X11 Forwarding Request Failed on Channel 0
Detect the Presence of a Device When It's Hot Plugged in Linux