I have a Synology DS1513+ running DSM5.0-4493 update 1 (a several-year-old OS).
I have Windows 7 and 10 laptops mounting that disk, along with a Linux laptop mounting the same area via NFS.
My development account on the Linux box and Synology is user ID 1000.
I'd like my Windows boxes to present that user ID as well so they have full permission to edit everything, create and delete files etc. (I develop software that is intended to work on both OS's so edit and build on both OS's.)
On the Windows 7 box long ago I apparently also set it's user ID to 1000 somehow, but on the Windows 10 box I'm user ID 4294967294. How can I change that to 1000?
When I "map network drive" I've tried checking "mount with different credentials," expecting it'd ask me for an alternate user ID, but it doesn't seem to ever query WHAT different credentials to use. (I also c an't think why the disk would take my word for it that I should be user 1000.)
I've also tried net use V: \\diskstation\volume1\MyDisk MyPassword /USER:SynologyUserName
and am told:
You can't connect to the file share because it's not secure. This
share requires the obsolete SMB1 protocol, which is unsafe and could
expose your system to attack. Your system requires SMB2 or higher. For
more info on resolving this issue, see:
https://go.microsoft.com/fwlink/?linkid=852747
I've also tried going to Control Panel\User Accounts\Credential Manager\Add a Windows Credential, and typing the share \diskstation\volume1\MyDisk, MyUser, and MyPassword. Upon OK:
This information cannot be
saved. Make sure all the information is correct and that all required fields are completed.
Error code: 0x80070057
Error Message: The parameter is incorrect.
I've also tried share as simply diskstation. Upon OK, it is accepted, and appears on Control Panel\User Accounts\Credential Manager as "diskstation" under Windows Credentials. But then I unmount and remount the share, try creating a file, and the UID is still 4294967294, not the 1000 of the name of the credential I created.
I've also googled for "map synology user ID." Not finding anything useful.
I've ssh'd in and did find
from /
for any config files with samba in the name and don't find anything. (Well, two tiny files, but don't seem to be samba.conf or anything for mapping users.)
I've also searched systematically through the synology's control panel over the http interface and nothing.
Your Synology box almost certainly is running Samba as the "Windows file sharing protocols" implementation.
In Samba, there's a concept called UID mapping, which maps Windows-style SIDs (long strings of numbers that are auto-generated under the hood when you make a new user in Windows) to UNIX-style UIDs (which usually start with small numbers like 1000 and increase into 6 digits for certain systems).
This is because Windows SIDs, which are the numerical identifiers for Windows accounts, are fundamentally different from UNIX UIDs, which are the numerical identifiers of UNIX accounts. They have different formats, and changing a Windows SID isn't easy (whereas it's quite easy to change a UNIX UID with root permissions).
Here's an example of the format of a Windows SID: S-1-5-21-1180699209-877415012-3182924384-500
The reason we have to "map" between SIDs and UIDs is, even if you tried to change a Windows SID to something like 1000
, it wouldn't work, because Windows expects SIDs for users to be of a certain length and syntax, including beginning with an "S" and having a bunch of long numbers with dashes in them.
If it's sufficiently old, it's probably running Samba 3. UID mapping in Samba3 is discussed here.
UID mapping in Samba4 is conceptually the same, but implemented by your choice of "identity mapping backend" -- see here.
Here's how to do identity mapping on a Samba4 domain controller: here.
However, wiki articles aside (they provide very useful conceptual information so you understand what's going on under the hood), the most useful information I could find specifically about this combination of things:
... is in this answer over on AskUbuntu, which deals with user names, not user IDs.
If you found that information useful, you should click through the link to AskUbuntu above, and toss Aaron an upvote for his good answer.
The key insight to take away from Aaron's answer is that, if your Windows username and password exactly match the Synology server user's username and password, you'll be able to get in without even performing any manual authentication (you won't have to enter any username/password), and from the Synology side, the UID you'll have for file/directory permissions will be set based on the UID of the user on the Synology side who has the same user name as your Windows account.
Another reason it probably doesn't work on Windows 10: If you log into Windows 10 with your Microsoft account, your user name isn't actually what you think it is! Your user name is your Microsoft account email address, under the hood; it just appears to be whatever "friendly" username you gave it in Win32 land (like you have the folder, C:\Users\swissfrank
instead of C:\Users\swiss.frank@gmail.com
).
So when you hit the Synology server with a username of swiss.frank@gmail.com
(instead of the user swissfrank
which has been properly created on the Synology side as UNIX user ID 1000), it treats you as a different user. This is by design, and definitely means you'd need a user name map like in Aaron's answer. The contents would be something like:
swissfrank = swiss.frank@gmail.com
User contributions licensed under CC BY-SA 3.0