Thursday, October 31, 2024

Re: mapping different client and server uid:gid for NFS

>> How can one get both entries to work?
>
> By having them on different filesystems. You can't have diferent options
> on different directories exported from the same filesystem.
>
> See "BUGS" in exports(5).

Thanks Stuart for pointing that out. I did read it but I didn't really
understand it at the time (which is likely my fault).

On that, does the example in the exports(5) not give a contradictory
option as a valid example when it is not?

For example:

/usr /usr/local -maproot=0:10 friends
/usr -maproot=daemon grumpy.cis.uoguelph.ca 131.104.48.16
/usr -ro -mapall=nobody
/u -maproot=bin: -network=131.104.48 -mask=255.255.255.0
/u2 -maproot=root friends
/u2 -alldirs -network=cis-net -mask=cis-mask

Given that /usr, /u and /u2 are local filesystem mount points, the above
example specifies the following: /usr is exported to hosts friends where
friends is specified in the netgroup file with users mapped to their
remote credentials and root mapped to UID 0 and GID 10. It is exported
read-write and the hosts in "friends" can mount either /usr or
/usr/local. It is exported to 131.104.48.16 and grumpy.cis.uoguelph.ca
with users mapped to their remote credentials and root mapped to the user
and groups associated with "daemon"; it is exported to the rest of the
world as read-only with all users mapped to the user and groups
associated with "nobody".

It seems to indicate you can export /usr with an option of -maproot=0:10
to some hosts, while exporting the same /usr local FS to another host
with a different option of -maproot=daemon . Is that wrong in the man
page? Or is it because they are being exported to different hosts.

No comments:

Post a Comment