如何让Windows挂载群晖共享时使用UID 1000以获取完整权限?
Alright, let's get your Windows machines aligned with that UID 1000 permission setup so your cross-system dev workflow runs smoothly. Since you're on the older DSM 5.0, we need to make sure both Synology and Windows settings are in sync—here's the Windows-side breakdown:
Before tweaking Windows, confirm your Synology is set to prioritize Unix permissions over Windows ACLs:
- Log into your DSM 5.0 control panel, go to File Services > SMB
- Switch to the Advanced Settings tab
- Turn off "Windows ACL Support" (this forces SMB to use Unix-style UID/GID permissions instead of Windows' own ACL system)
- Turn on "Enable Unix Permissions" (this lets Synology map SMB user credentials to Unix UIDs/GIDs)
- Save changes and restart the SMB service (look for the restart button at the top of the SMB settings page)
1. Create a Local User Matching Your Synology Dev Account
- Open Control Panel > User Accounts > Manage Accounts > Create a new account
- Name it exactly the same as your Synology dev account (e.g.,
devuser) and set the same password—this avoids credential mismatches later - We need to map this local user to UID 1000, since Windows doesn't use UIDs natively. Fire up an elevated Command Prompt (right-click > Run as administrator) and run these two commands:
(If your Synology dev account uses a different GID, replacereg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v "DefaultUid" /t REG_DWORD /d 1000 /f reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v "DefaultGid" /t REG_DWORD /d 1000 /f1000with that value in the second command.)
2. Mount the Synology Share with the Correct Credentials
- Open This PC, right-click empty space, select Map network drive
- Enter your Synology share path (e.g.,
\\192.168.1.100\dev_shared) - Check the box for Connect using different credentials, then click Finish
- In the login prompt, enter
.\devuser(the.\tells Windows to use your local account) and the password you set earlier. Check Remember my credentials to avoid retyping later. - Click OK, and your mapped drive will now access the share using UID 1000—matching your Linux and Synology setup.
3. Verify It Works
- Create a test file in the mapped drive, then hop over to your Linux machine or Synology DSM. Run
ls -lon the file—you should see your UID 1000 account listed as the owner. If that's there, you've got full read/write/delete access across all systems.
Windows 7 uses slightly different registry keys for UID mapping, but the core idea is the same:
1. Create the Matching Local User
Same as Windows 10—make a local account with the same name and password as your Synology dev account.
2. Map UID/GID via Registry
Open an elevated Command Prompt and run these commands (note the different key names vs Windows 10):
reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v "AuthUid" /t REG_DWORD /d 1000 /f reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v "AuthGid" /t REG_DWORD /d 1000 /f
3. Mount and Verify
Follow the same mapping steps as Windows 10: use .\devuser to log in, then create a test file to confirm the owner is UID 1000.
- If permissions still don't work, restart your Windows machine—registry changes require a reboot to take effect.
- Double-check your Synology share permissions: right-click the share in DSM > Properties > Permissions, make sure your dev account has full read/write/delete access.
- Avoid using your Windows admin account to mount the share—admin credentials can override the UID mapping we set up.
内容的提问来源于stack exchange,提问作者Swiss Frank

