I have a folder that I need for two different user accounts to be able to fully access.
Both user accounts need to be able to read and write to all of the files within this folder, including its subdirectories.
Any new files or folders created by either user anywhere within this directory or any of its subdirectories need to be both readable and writeable by the other user.
Both users need to be able to delete any file within this folder or its subdirectories.
Is there a way to accomplish this?
What I've tried
- Using
/Users/Shared/Documents
. Unfortunately files and folders created by one user can't be written to by the other user. - Setting the
setgid
bit on the folder - Setting the folder's group to one shared by both users
- Setting the folder's permissions to
775
But every time either user creates a new file, its permissions will be 644
and the other user won't be able to write to it.
As requested, here is the result of executing ls -la
inside the folder in question, which is located at /Users/Shared/test
, as well as creating a file. The folder's permissions are set to 775
and its setgid
bit is set. As you can see the permissions on the file exclude other users from writing to it:
$ ls -la
total 0
drwxrwsr-x 2 test staff 64 May 16 23:18 .
drwxrwxrwt 31 root wheel 992 May 16 23:18 ..
$ touch file.txt
$ ls -la
total 0
drwxrwsr-x 3 test staff 96 May 16 23:23 .
drwxrwxrwt 31 root wheel 992 May 16 23:18 ..
-rw-r--r-- 1 test staff 0 May 16 23:23 file.txt
/Users/Shared/Documents
?ls -l
output of the folder you've tried setting the GUID on? It would show if the bit is actually set. Another idea to look into: umasks. Perhaps these will persist the group setting?