I want to access an NFS share from within a Docker container. I don't have control over how that Docker container is started, so I can't run it in privileged mode etc. But honestly, I don't even want to run it in privileged mode because that is a completely unnecessary security risk.

It's a shame that the standard utility mount always requires root privileges. In my opinion a non-root user should simply be allowed to mount to whatever locations that user has permissions for. Is there an alternative tool that would allow me to access that NFS share without root privileges?

  • Unfortunately, NFS cannot be used without sudo (to mount, or to modify fstab). However, other network protocols (like SSH/SMB/FTP/HTTP) have a CLI for non-root user. See also: superuser.com/questions/885662/…
    – Noam Manos
    Apr 20, 2020 at 8:16

2 Answers 2


This isn't possible without having root access to either execute the mount command or the ability to install additional software within the container, again you'd need root/sudo access to do this.

The closest you can get to something that might be usable here for you would be to setup the NFS entry within the container's /etc/fstab file with the user option, so that non-root users could mount it.

$ cat /etc/fstab /home/alice/Desktop/mnt nfs rw,noauto,user 0 0


  • I think it is possible. It's just not possible with the mount utility. And btw you can install additional software without root privileged in Linux. Besides that inside the Docker container you have root privileges to a certain degree. From what I understand changing the /etc/fstab of the container won't have an effect.
    – Forivin
    Jun 26, 2018 at 7:56

Inside the server machine you need to create a folder with the "Others" group having write access.

I'm still figuring out how to force NFS to force an umask for every new file that you create on that share, but that should get you started.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .