linux - How to use NFS mounted storage as particular user

06
2014-04
  • Tomas

    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...

  • Answers
  • user256717

    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


  • Related Question

    linux - How to recursively mount file shares?
  • brady

    I have a Linux machine that shares some files through NFS. The shared directory is:

    /foo
    

    I then mounted a shared directory (from a Windows machine) to:

    /foo/bar
    

    /foo/bar is mounted successfully onto the Linux machine and everything is there. However any other machine that mounts /foo from the Linux machine everything is correctly there except /foo/bar is empty.

    Is there anyway to do a "recursive mount" of file shares.

    Here is the /etc/fstab entry for the Windows share mount of /foo/bar

    //windows_machine/share /foo/bar cifs username=user,password=pass 0 0
    

    And the /etc/fstab entry on the client machines that mount /foo

    server:/foo /foo nfs rw 0 0
    

  • Related Answers
  • Ignacio Vazquez-Abrams

    You want the nohide export option.