Group permissions allow, but still get permission denied
Did you recently add that user to that group, without logging out/in between? Then "groups" will show the group but the user does not have the group permissions yet.
You can show your effective groups using
$ id
As an example, if I add my user ps
to the group fax
and then type
$ id
it does not show the group fax
, but
$ groups ps
shows fax
.
Doing su
to your own user gives you the new group affiliation:
$ su ps
$ id
The output now also contains fax
.
The method that you have used seems to be correct. I just now tried to replicate it, and it worked just fine.
I am not sure if there is a typo, but there is a slight problem with the command. There is no need to have "mygroup" mentioned in there. The following works
# chmod -R g+swrx /mount/abc
Even, you can remove the s
bit, just do g+rwx
. After you have changed the permissions, and you do ls -l
, it should display the relevant privileges.
You cannot remove the file because the group mygroup
doesn't have write permissions on the file test.png
as well as the folder. For write operations to work on the file the file permissions should look like:
-rw-rwxr-- 1 otheruser mygroup 159539 Apr 23 23:44 test.png*
If you take a closer look at the permission format
duuugggooo
The first three placeholders uuu
are user read, write and execute. The next three placeholders ggg
are for the group and ooo
for others. In the snippet posted by OP group is missing the write permission.