Windows SMB access issue

I have two almost identical datasets (identical except record size), two identical shares with identical share ACL and dataset ACL, and both shares are seen by Windows, yet one share is accessible from Windows and the other isn’t. They are both the type of share which presents a different root directory for each user - and both sub-datasets exist and the ACLs for these sub-datasets are also identical.

I have double checked everything and cannot see any differences yet I cannot get one of them working.

Does anyone have any ideas what the problem might be?

Are you using ’ SMB Home Shares’?
Are you talking about the system in your signature?
You should probably give more details. Any error messages?

The SMB share is set up as Private SMB Datasets and Shares and Use as Home Share not checked.

Not working


Working


The system is as in my signature (though hardware does not appear really part of the problem).

The only error message is:
image

But I can access the UserBackups share.

Does the same TrueNAS user own both share’s root paths?

What I’m guessing is: Windows is using the same cached credential (username/password) for both shares, because they’re from the “same server”. However, while the server is the same, the paths and ownership/permissions are not.

Windows is stupid like that.

One way around that is to create aliases in your hosts file.

There are actually 4 shares on this server and my Windows PC can access 3 of them using the same credentials, but not this one.

Try this in Windows:

  1. CTRL + SHIFT + ESC
  2. Scroll down to the process “Windows Explorer” and click “End task”
  3. Go to “File” → “Run new task” → check the box “Create this task with administrative privileges.” → type and run the command “notepad”
  4. In the Notepad window that launches, go to “File” → “Open”
  5. Change the drop-down from “Text Documents” to “All Files”
  6. Browse and open the file C:\Windows\System32\drivers\etc\hosts
  7. Add a new entry in this format:
    192.168.0.2 TERRABLASTER
  8. “File” → “Save”
  9. Exit Notepad and in the Task Manager go to “File” → “New task” → run the command “explorer”

Now try to access the share via \\TERRABLASTER\SystemBackups

* Change the IP address to that of your TrueNAS server.

A good place to start would be to review logs /var/log/samba4/log.smbd.

2 Likes

Thank you - this was a great help.

I found this error message:

[2024/07/10 14:11:57.917818,  0] ../../source3/smbd/smb2_service.c:117(chdir_current_service)
  chdir_current_service: vfs_ChDir(/mnt/hdd-pool/SystemBackups/paul) failed: Permission denied. Current token: uid=1001, gid=1000, 6 groups: 1000 545 5001 90000005 90000012 90000017

and I checked the permissions again on the user-specific child dataset and found that the flags were ever so slightly different from other child datasets. And when I fixed that it all started working.

So it wasn’t a Windows idiosyncrasy but rather a TrueNAS configuration issue.

2 Likes

What was the flag?

Based on the error message it means that paul lacked execute permissions on either /mnt/hdd-pool/SystemBackups or /mnt/hdd-pool/SystemBackups/paul and hence the smbd process couldn’t chdir into the share root (because it setresuid() to that account).

1 Like