0

I have a machine which acts as a NFS server, this machine shares files with others. Developers use the dev-user to upload files to the NFS server, but in the NFS client those files need to be owned by web-user, and devs don't have the credentials to log into the web servers everytime and do chown to those files. I want that everytime files are uploaded to the NFS client they are owned automatically by web-user.

I have tried with ACL with no result. And Nfsv4_ACL is confuse.

Is this possible? or do i have to seek other options?

0diseus
  • 1
  • 2

1 Answers1

0

Several hacks and work-arounds are possible. In no particular order:

  • synchronise the UID numbers used for the dev-user and web-user accounts.
    That may have impact elsewhere so that will take careful planning.

  • rather than using NFS use SMB to export and mount the file share.
    The CIFS (SMB) mount option supports the uid=arg, gid=arg and forceuid arguments to set the uid/gid that will own all files or directories on the mounted filesystem from the client. The ID's may be specified as either a name or a numeric uid/gid.

  • NFSv4 allows for ID mapping and translation. See for example man idmand.conf and Mapping UID and GID of local user to the mounted NFS share
    That should allow you to for example use on your web-servers:

    # /etc/idmapd.conf
    ...
    [Static]
    
    dev-user@NFS-SERVER.EXAMPLE.COM = web-user
    
bob
  • 181
  • 1