force group = 65534
force user = 65534
# or
force group = nogroup
force user = nouser
Alternatively, you can force new files to inherit owner of the folder they are in:
inherit owner = yes
inherit permissions = yes
Also:
create mask = 777
directory mask = 777
# or
force create mode = 666
force directory mode = 777
Don't forget to restart samba service after changing the share settings.
References:
- https://man.freebsd.org/cgi/man.cgi?query=smb.conf
- https://www.thegeekdiary.com/how-to-force-user-group-ownership-of-files-on-a-samba-share/
- Set
inherit owner = yes
- Enable ALCs
-
- When ALCs are disabled, folder group is not inherited for some reason
- Optionally set
force user = 65534
-
- You can set
force user = root
to allow access to everything
- You can set
- Edit Share ACLs (don't confuse with dataset ACLs)
-
- Set main entry to:
-
-
- SID:
S-1-1-0
- SID:
-
-
-
- Domain: empty
-
-
-
- Name:
Everyone
- Name:
-
-
-
- Type:
DENIED
- Type:
-
-
- Set another entry to:
-
-
- Domain:
Group
orUser
- Domain:
-
-
-
- Name: your desired group or user
-
-
-
- Type:
ALLOWED
- Type:
-
- Make sure your user has required auxiliary group
- Restart samba service to apply new settings
References: