1

I have a NFS storage where I want to create and modify files from my local machine. On that NFS server there is a user with a group. But when I write a file from some local application to that storage, that file has a different user belonging to a different group. How can I force my local application to pretend to be the user from the NFS machine?

This also causes trouble when I want to modify existing files - I don't have write permissions...

2 Answers 2

1

The NFS server maps the users based on their uid and gid, not on their names. So if a user has a same name on the client side and on the server side, but different uid's, you end up with this kind of problems. There exists solutions to completely redefine the mapping, but doesn't seem to be easy (and I can't help). However, in the context of a single user there is an easy solution: map all the client side users to a single user on the server side. This is achieved with the all_squash export option, together with anonuid= and anongid= to specify the target user on the server side.

0

You have to force on the server side. On the exports file you have to specify anonuid=xxxx,anongid=xxxx on the option of the directory exports. Replace xxxx with server userid (anonuid) and server groupid (anongid)

omar

1
  • Setting anonuid and anongid will just map the client root user to the specified server user.
    – PierU
    Commented Oct 1, 2022 at 10:32

You must log in to answer this question.

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