TrueNAS SMB Share - files show a different group under Ubuntu (root) vs (myusername) under Windows and TrueNAS

petreza

New Member
Dec 28, 2017
29
2
3
I have setup a SMB share (and a NFS share too) in Truenas 12.0-U8. Shout-out to David McKone's detailed guide(s for both) on youtube:


The user name and primary group on both TrueNAS and my Ubuntu Desktop are the same: myusername:myusername.
When I setup the ACL for the dataset I applied the file permissions recursively.
In both TrueNAS Shell and Windows files show as myusername:myusername
but in Ubuntu they show as myusername:root
How do I fix that?

(
When I setup the NFS share I had a similar problem with Ubuntu. The files were showing as
nobody
In that case I had to edit /etc/idmapd.conf to match the Domain with the one setup in TrueNAS. Maybe this issue is related - that's why I mention it.
)

Thanks!
 
Last edited:

acquacow

Well-Known Member
Feb 15, 2017
661
352
63
40
NFS will expose things with user and group ID numbers... how's the GID on those files vs the GID in on your Ubuntu box?
 
  • Like
Reactions: itronin

petreza

New Member
Dec 28, 2017
29
2
3
Thanks, but the problem is with the SMB share, not the NFS. I mentioned the NFS parenthetically only because it had similar issue, which is now resolved.

Let me reiterate for clarity:

TrueNAS:
Users: myusername - UID 1000
Groups: myusername - GID 1000
SMB share of MyDataset
"Edit Permissions" of MyDataset:
--- user: myusername; 'check' Apply User
--- group: myusername; 'check' Apply Group
--- Access Control List:
+++ owner@; Full Control
+++ group@; Full Control
--- 'check' Apply permissions recursively
at the TrueNAS shell:
--- ll -n
inside the MyDataset shows 1000:1000

Windows client:
right click --> Properties --> Security Tab --> Group and user names: myusername, myusername

Ubuntu client:
(mounted through /etc/fstab)
ls -n
shows 1000:0
id myusername
uid=1000(myusername) gid=1000(myusername) groups=1000(myusername),4(adm),24(cdrom),27(sudo).....
id root
uid=0(root) gid=0(root) groups=0(root)
If I create a new file through Ubuntu it again shows 1000:0 on Ubuntu and 1000:1000 in TrueNAS shell.
I want ls -n to show 1000:1000 on Ubuntu as it is supposed to.

Thanks!
 
Last edited:

BShoppy

New Member
Apr 16, 2021
14
7
3
Do you have uid=1000, gid=1000 set as options in your /etc/fstab mount?

That is how I get Linux clients to mount with the correct user/group
 

petreza

New Member
Dec 28, 2017
29
2
3
Do you have uid=1000, gid=1000 set as options in your /etc/fstab mount?

That is how I get Linux clients to mount with the correct user/group

This was it. Thanks!
I only had uid=1000.
I added gid=1000 and after a reboot it shows correctly.
So, the "credentials=/path/file" of the cifs mount in fstab is strictly for gaining access to the share files. Once mounted, they show according to the "uid=####,gid=####" parameters in fstab.