0

I have a test group d with 3 users (from /etc.groups d:x:1004:u1,u2,u3)

I have created shared folder /home/test/photos which is owned by root and group set to d.

I need to allow everyone in group d to write in that folder and read every file but only owner should be allowed to edit/remove the file.

I have tried setgid/setuid but without success.

  • If the directory's permissions are 0775 (rwxrwxr-x), then group members will be able to create, rename and delete files in it. – AFH Dec 13 '18 at 18:07
0

You need the sticky bit, similar to /tmp that has mode 1777. Setting this bit means that only the owner can rename or remove file.

For the permissions on the files, you must make sure that the group permissions are read only.

If you don't want to modify the users' umask, the use setfacl on the directory with the -d option:

From man setfacl

-d, --default
All operations apply to the Default ACL.

From man acl

In addition, a directory may have an associated ACL that governs the initial access ACL for objects created within that directory; this ACL is referred to as a default ACL.

The default ACL specifies what ACL (access permissions) should be applied to new files and directories within the specified directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.