I would like to mount an AWS EFS location with the efs driver which internaly uses nfs. Now the question is: How do I automatically mount a location with specific uid and gid? With sshfs e.g. I would just define uid, gid as mount options, but it's not implemented in nfs.
Nfs – How to mount with uid and gid using NFS
amazon-efsnfsnfs4
Related Topic
- Nfs – OpenBSD Apache configuration: NFS mount
- Nginx – Debian 7 NGINX OwnCloud – move data-folder to NFS-mount permission problems
- Nginx – Permission denied with nginx and nfs
- Ubuntu – How to configure NFSv4 mount so that owner of files created by root user on NFS client appear as ‘root:root’, rather than ‘nobody:nogroup’ on client
Best Answer
A regular Linux NFS server would do the trick with the following combination of
/etc/exportfs
options:Citing
man 5 exports
:all_squash
- Map all uids and gids to the anonymous user.anonuid
andanongid
- These options explicitly set the uid and gid of the anonymous account.With Amazon EFS you'll need locally mounted
bindfs
layer to change permissions as the server export options cannot be changed.Please take a look at this Unix & Linux StackExchange question.
It looks like the
bindfs
currently lacks ability to map all users/groups into one but I guess it could be added to the code quite easily.