Linux – NFS: force file mode/mask on mount

linuxmountnetwork-attached-storagenfs

I have a QNAP NAS on my network that exports some NFS shares, which I'm mounting on a linux machine. One of the shares has data only (no executable files). However, when I mount the NFS share, all the files show up as -rwxrwxrwx (777).

I have the share mounted with noexec, but I was wondering if there was a way to mount the share such that the files would appear as if their mode was -rw-r--r-- (644)?

Best Answer

My understanding is that NFS works off of whatever file system permissions are set on the server's file system. You should be able modify these by issuing a chmod on either the client, or the server (although I don't know if you have access to the command line on the QNAP device).

With regards to the noexec option, that simply prohibits executable files from being ran on that file system... it doesn't prevent you from setting the execute bit in the files permissions.

Hope this helps!