Nfs – Mount an NFS share as non-root in fstab

fstabmountnfspermissions

A tomcat server that is run as root (i.e. web app using port 80) needs access to an NFS share to store uploaded files, which the root account does not have access to. Unsurprisingly, when the web application attempts to store a file, a permission exception is thrown.

Can I mount the share as a non-root user, so that the web server is able to access the share without permissions issues?

Best Answer

On the NFS server, change the export and add a -maproot=some_user option. This will make it so any "root" user accessing the share will be given the access rights "some_user" would normally have.

Related Topic