5.9.3. Mounting an NFS File System
By default, NFS mounts on the client side are labeled with a default context defined by policy for NFS file systems. In common policies, this default context uses the nfs_t
type. Depending on policy configuration, services, such as Apache HTTP Server and MySQL, may not be able to read files labeled with the nfs_t
type. This may prevent file systems labeled with this type from being mounted and then read or exported by other services.
If you would like to mount an NFS file system and read or export that file system with another service, use the context
option when mounting to override the nfs_t
type. Use the following context option to mount NFS file systems so that they can be shared via the Apache HTTP Server:
mount server:/export /local/mount/point -o\
context="system_u:object_r:httpd_sys_content_t:s0"
Since context changes are not written to disk for these situations, the context specified with the context
option is only retained if the context
option is used on the next mount, and if the same context is specified.
As an alternative to mounting file systems with
context
options, Booleans can be turned on to allow services access to file systems labeled with the
nfs_t
type. Refer to
Section 5.6.3, “Booleans for NFS and CIFS” for instructions on configuring Booleans to allow services access to the
nfs_t
type.