Page

SMB Shares

Page IDsmb-sharesUpdated

What do I set my ACL permissions to in truenas scale for my SMB dataset that has ACL mode set to restricted, so that when I create a new file via the SMB share on windows that it maintains the correct owner and group as set in the ACL?

๐Ÿ”‘ TrueNAS SCALE SMB ACL Permissions Guide (Restricted Mode) ๐Ÿ”‘

Goal: Maintain correct owner & group for new files created via SMB from Windows in a Restricted ACL mode dataset.

๐Ÿ”Ž Understanding the Challenge

Windows & TrueNAS handle ownership differently. Restricted ACL mode requires specific settings to bridge this gap. Without them, new files default to nobody ownership.

โš™๏ธ Configuration Steps

1. SMB Share Settings: ๐Ÿ–ฅ๏ธ

  • Access Based Share Keys: โœ… Enabled (Highly Recommended for Security)

  • ACL Mode: ๐Ÿ”’ Restricted (You've already set this!)

  • VFS Objects: ๐Ÿงฉ

    • fruit: ๐Ÿ‘ Enabled

    • streams: ๐Ÿ‘ Enabled (Important for Windows extended attributes)

    • xattr: ๐Ÿ‘ Enabled (Crucial for ACL persistence!)

    • posix: ๐Ÿ‘ Enabled (Necessary for owner/group translation)

2. posix VFS Object Settings (Advanced): ๐Ÿ› ๏ธ

Within the posix VFS object configuration (accessed by clicking the โš™๏ธ icon next to it):

  • mapall: ๐Ÿšซ Disabled (Let's be precise!)

  • maproot: ๐Ÿ‘ค Typically root, but consider a dedicated SMB user if preferred.

  • mapto: ๐Ÿ‘ค The user/group to map to. This is where the magic happens. See โ€œMapping Strategyโ€ below.

  • noperm: ๐Ÿšซ Disabled (We want permissions to be applied!)

  • prefixes: ๐Ÿ“ Add a comma separated list of windows users to translate. Example: domain\user1,domain\user2

  • suffix: ๐Ÿ“ Add a suffix to usernames. Example: @domain.com

3. Mapping Strategy: ๐Ÿ—บ๏ธ

This is the core of the solution. How you map Windows users to TrueNAS users depends on your setup.

  • Option 1: Direct Mapping (Recommended): ๐Ÿ‘ฏ

    • Create TrueNAS users that exactly match Windows usernames (case-sensitive!).

    • Within the posix settings, add prefixes to map those Windows users to the TrueNAS users. This ensures a 1:1 translation.

  • Option 2: Group Mapping: ๐Ÿ‘ฅ

    • Create a TrueNAS group that corresponds to a Windows user/group.

    • Map the Windows user to this TrueNAS group using posix. This simplifies management but might be less granular.

4. ACL Configuration on the Dataset: ๐Ÿ“‚

  • Dataset Properties > Permissions > ACL Mode: โœ… Restricted (Again, verify!)

  • Dataset Properties > Permissions > ACL Type: โœ… POSIX ACL

  • Set ACLs: Apply POSIX ACLs to the dataset defining default owner and group. For example:

    • User:domain\username:Owner

    • Group:domain\groupname:Group (Or a specific TrueNAS group)

    • Apply these to the root of your SMB share and consider applying them recursively if desired.

โš ๏ธ Important Considerations:

  • Case Sensitivity: TrueNAS is case-sensitive. Usernames must match.

  • Windows User Mapping: Ensure the Windows users have corresponding accounts in TrueNAS (or map them to a group).

  • Testing: Always test with a small number of users before rolling out changes widely. Create a test file via SMB and verify ownership/group.

  • Restart SMB Service: After making configuration changes, restart the SMB service in TrueNAS SCALE for them to take effect. ๐Ÿ”„

โ„น๏ธ Troubleshooting:

  • Files Created as nobody: Double-check your posix configuration and ensure users are correctly mapped.

  • Permissions Issues: Verify ACLs are correctly applied on the dataset and that the mapped user has appropriate permissions.

  • SMB Logs: Examine the TrueNAS SCALE SMB logs for errors or warnings. ๐Ÿ”