0

I have two NFS servers running Ubuntu (server0, server1). My client is on Windows 10. The Unix accounts for this client on each servers have different UID and GID, it is something like 1002,1002 on server0 and 1008,1007 on server1. In regedit HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default I added AnonymousUid and AnonymousGid with 1002 and 1002, respectively, but it applies to all NFS shares.

For example, network storage Y: should have UID/GID 1002,1002 ans Z: should have UID/GID 1008,1007.

How to assign different UID and GID to each NFS folder?

1 Answer 1

0

To assign different UID and GID to each NFS folder for Windows client for the local user named <Unix_user>, use the following two files:

  • C:\Windows\System32\Drivers\etc\passwd, where the syntax is:

      [domain]\<Unix_user>:x:<Unix_UID>:<Unix_GID>:User Description,,,:c:\users\<Unix_user>
    
  • C:\Windows\System32\Drivers\etc\group, where the syntax is:

      [domain]\<Unix_group>:x:<Unix_GID>:<Unix_UID>
    

Reference: Mounting NFS Shares in Windows Using Identity Mapping.

5
  • I don't understand where is the link within these files between the UID/GID and the network storage. Let's the letters are Y: and Z:, both will still have the same UID and GID, won't they?
    – Clèm
    Commented Sep 8, 2020 at 13:05
  • That's the way to have separate UID/GID to separate NFS shares. Wasn't this what you wanted?
    – harrymc
    Commented Sep 8, 2020 at 15:27
  • Let's try an example with C:\Windows\System32\Drivers\etc\passwd My login on Windows is foobar. My logins on Linux are foo (on server0, 1002,1002) and bar(on server1, 1007,1008) foobar:x:1002:1002:User Description,,,:c:\users\foobar foobar:x:1008:1007:User Description,,,:c:\users\foobar Is it correct? If so, how does Windows knows that Y: should be associated with 1002,1002 and Z: with 1007,1008?
    – Clèm
    Commented Sep 9, 2020 at 9:29
  • My mistake in the above above commands, now corrected. The difference is by the [domain] parameter. If both references are to the same domain, this solution won't help.
    – harrymc
    Commented Sep 9, 2020 at 9:35
  • They are and it cannot be changed, unfortunately. I talk with my IT department, and, as far as they know, there is no solution. We'll try to move to Samba, but it doesn't seems to work anymore on Windows 10 since June (I like the irony). Anyway, thanks!
    – Clèm
    Commented Sep 9, 2020 at 13:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .