I'm having a bit of trouble with AutoFS on my setup. I've got an NFS server that connects to my machine and automatically mounts folders, but it keeps mounting them under root:root. I really need it to mount as minio-nfs:minio-nfs instead. My auto.nfs file looks like this: `data fstype=nfs3,rw,uid=1007,gid=1008 10.10.9.0:/nfs/minio/data`. I've checked and the UID and GID are correct on both the NFS server and my local machine. Any suggestions on how to fix this?
2 Answers
NFS actually doesn't handle permissions the way you’re expecting. The permissions are based on the server's filesystem. This means that when a client with uid=123 interacts with a file, the server checks what access that uid has on its own system. You should modify the permissions on the NFS server to match the minio-nfs uid/gid on the client. If your server supports ACLs, you could potentially set those up, but be careful with default ACLs since they might not behave as you hope.
Unfortunately, it seems like the uid= and gid= options aren't recognized in your current mount.nfs man page. I searched it thoroughly, and there's no mention of these options anywhere in the documentation. You might need to look for alternative ways to handle user permissions.
That's frustrating! So what should I do then?