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.
Asked
Active
Viewed 2.8k times
2 Answers
4
A regular Linux NFS server would do the trick with the following combination of /etc/exportfs
options:
all_squash,anonuid=xxx,anongid=yyy
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.

kupson
- 3,578
- 20
- 19
-
Thanks, bindfs might be that, eventhough I dont like the idea of having another program taking care of the permissions as a fuse bind. Reasons are performance, and stability. There is no automount option when something goes wrong with the NFS mount. – Aley Oct 19 '18 at 06:43
-
Not work for me to mount AWS EFS with command `sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport
.efs.cn-northwest-1.amazonaws.com.cn:/ /mnt/efs`. – Kane Jan 29 '20 at 13:29
0
Seems like just setting the user and permission on the files, do the job. So nfs is supporting standard fs file permissions and attributes.

Aley
- 209
- 2
- 4
- 16