I’m sure this question has been asked and answered before, but I can’t seem to find it. Probably partly because I’m not searching for the right thing. My subject could be misinterpreted for what I’m looking to do.
I am trying to figure out how to handle permissions on datasets when there might be multiple users accessing / writing files etc.
For example if I have 2 users, and put them both in the group “shareusers”, when they write files to a dataset that gives the group shareusers full control, the file will be owend by them and have a group of shareusers. But what if I want to just make files always owned by root and group shareusers?
I’m trying to make sure permissions for files / folders stay consistent on shared datasets and not run into issues where one user might write a file and somehow the another user can’t modify it / delete it / etc. This problem has been exacerbated recently by me setting up a container to run some scripts (had to do it in a container cause Truenas lacks some useful file handling / transfer apps like lftp for one example). Today after a bunch of trial and error I was finally able to get consistent permissions to even read and write by the container (ended up having to use NFSv4 ACL because no matter what I did the default POSIX ACL would have permission problems). But now, when I write a file with the root user on that container, sometimes it will be owned by the 2147000001 ID and have a group of shareusers, but sometimes it will be owned and have the group of 2147000001. The 2nd seems to happen more if I’m modifying an existing file rather than creating a file. But this is a rather annoying problem that sometimes I’ll go in and a file that was modified in the container can’t be accessed by other users of the datasets and the only way for me to fix it is to go in as root and chown the file.
I’ve tried various configurations of mapping my shareusers group to various gids in the container. Created the shareusers group in the container and tried mapping to it. But no mappings seem to work.
So, I’m wondering if there is simply a way to force files in a dataset to always be owned by root and have a group of shareusers, regardless to who / where it gets edited or created?