Who gets ownership of a mounted file/folder in NFS?

1

I am stumped with a problem I raised over on superuser and I basically got around it by using NFS version 3. Now, although I no longer have the user 4294967294 problem, now the files I mount are all owned by a user other than that which I want (RaspberryPi's original pi instead of the one I created, raspi1). Both users have root access, so my question is how are ownerships assigned under NFS? Is there anyway to designate who owns a file or is it based on the mount location?

puk

Posted 2013-10-02T22:37:55.280

Reputation: 607

Answers

1

Apparently there is a map_static option which you can use in /etc/exports to specify mappings between client and server UIDs/GIDs, but that is deprecated. Turns out, the UID and GIDs must be identical on both machines. I find this a little silly, but can easily be achieved through a few commands such as usermod and groupmod.

puk

Posted 2013-10-02T22:37:55.280

Reputation: 607

Silly as it may seem to you, NFS was designed primarily as a complement to NIS. In an NIS domain, all users authenticate to the same directory, regardless of the client, and thus all have consistent UID's between systems. – nod – 2013-10-03T01:39:25.710

1

You can use:

anonuid=1234,anongid=1234

in your /etc/exports, to define the user/group under which all files and folders will get written onto your NFS destination.

desasteralex

Posted 2013-10-02T22:37:55.280

Reputation: 111

Thank you. Could you maybe provide a sample line illustrating how to add those flags. – puk – 2013-10-03T20:37:38.317