Is it ok to have files owned by a non-existent user

nfspermissionsusers

I have a server A with a mounted volume that is shared via NFS with server B and C.

If I create a file on that volume using a user X in group Y that only exists on server A, will that create any problems with the sharing of that file through NFS? Will server B and server C be able to read the file ok if the 3rd party permissions including reading?

Best Answer

Yes, it's fine.

UNIX doesn't really care about names. For file permissions, it's the numbers that are important; when you try to access the file, it'll see if your UID matches, then GID, then it'll use the "other" permissions. As long as the "other" permissions include reading, you'll be able to read those files.

It doesn't check to see if a user or group exists for that number unless you're running something like ls that shows user and group names (in which case, it'll just show the number).

On my home server I have many UIDs and GIDs that do not exist on any other machines; NFS handles it just fine. FreeBSD server, OpenBSD and Linux clients.

Related Question