2

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
Bri Bri
  • 1,940
  • 6
  • 25
  • 39
  • Have you tried `/Users/Shared/Documents` ? – Tetsujin May 14 '22 at 18:01
  • 1
    @Tetsujin It has the same issue. Newly created files and folders can't be written to by the other user. – Bri Bri May 14 '22 at 18:03
  • Can you indicate what exactly you've tried with unix permissions and ACL's? I think if you [add both users to the same group and set GID on the directory](https://superuser.com/a/19333/141595) it should work. – Saaru Lindestøkke May 14 '22 at 18:59
  • @SaaruLindestøkke I've tried setting the "set GUID" bit on the folder, set the folder's group to one shared by both users, and then set 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. – Bri Bri May 14 '22 at 23:32
  • 1
    Can you perhaps share the `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](https://support.apple.com/en-us/HT201684). Perhaps these will persist the group setting? – Saaru Lindestøkke May 15 '22 at 16:43
  • @BriBri Please put all information in the question not in comments or on another site – mmmmmm May 17 '22 at 09:02
  • 1
    Done. @SaaruLindestøkke The info you requested is now edited into the question. – Bri Bri May 17 '22 at 13:50
  • Excellent, thank you very much for sticking with us and providing all required info. I was in the middle of trying out different things when I stumbled on the question linked above. – Saaru Lindestøkke May 17 '22 at 14:26
  • @SaaruLindestøkke Yes, that does the trick. Thanks! – Bri Bri May 17 '22 at 14:52

0 Answers0