How to enforce same owner on all files in a dataset?

pcubed

Cadet
Joined
May 10, 2021
Messages
7
Hi folks,

I'm upgrading a system (which I just took over) from FreeNAS 9.2.0 to TrueNAS Core 12. There was a behavior setup in the old version of FreeNAS for our Windows Shares (used with Active Directory services) that every file in the share had the same owner by default (in this case, the domain admin) regardless of who created the file. I'm not sure if it came from the old option "Inherit Owner", which I can no longer see in the options in TrueNAS, or not (see attached image). Is there a way to replicate this behavior in TrueNAS?

Thank you for your help in advance!
 

Attachments

  • Y7FweN18RH.png
    Y7FweN18RH.png
    20.8 KB · Views: 333

pcubed

Cadet
Joined
May 10, 2021
Messages
7
Set the auxiliary parameter inherit owner = yes.

Thank you for your reply. I tried using it and I couldn't get that parameter to work, but I stumbled upon the option force user in Samba 4 and it find that it works best and has its functionality described clearly.

force user (S)

This specifies a UNIX user name that will be assigned as the
default user for all users connecting to this service. This is
useful for sharing files. You should also use it carefully as using
it incorrectly can cause security problems.

This user name only gets used once a connection is established.
Thus clients still need to connect as a valid user and supply a
valid password. Once connected, all file operations will be
performed as the "forced user", no matter what username the client
connected as. This can be very useful.

In Samba 2.0.5 and above this parameter also causes the primary
group of the forced user to be used as the primary group for all
file activity. Prior to 2.0.5 the primary group was left as the
primary group of the connecting user (this was a bug).
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
inherit owner causes newly created files to be owned by the owner of their parent directory. Force user, forces the user to be the one specified. These have different security implications. The latter potentially opens up your share security-wise.
 
Top