Product SiteDocumentation Site

5.6.3. Booleans for NFS and CIFS

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. Also, by default, Samba shares mounted on the client side are labeled with a default context defined by policy. In common policies, this default context uses the cifs_t type.
Depending on policy configuration, services may not be able to read files labeled with the nfs_t or cifs_t types. This may prevent file systems labeled with these types from being mounted and then read or exported by other services. Booleans can be turned on or off to control which services are allowed to access the nfs_t and cifs_t types.
The setsebool and semanage commands must be run as the Linux root user. The setsebool -P command makes persistent changes. Do not use the -P option if you do not want changes to persist across reboots:
Apache HTTP Server
To allow access to NFS file systems (files labeled with the nfs_t type):
/usr/sbin/setsebool -P httpd_use_nfs on
To allow access to Samba file systems (files labeled with the cifs_t type):
/usr/sbin/setsebool -P httpd_use_cifs on
Samba
To export NFS file systems:
/usr/sbin/setsebool -P samba_share_nfs on
FTP (vsftpd)
To allow access to NFS file systems:
/usr/sbin/setsebool -P allow_ftpd_use_nfs on
To allow access to Samba file systems:
/usr/sbin/setsebool -P allow_ftpd_use_cifs on
Other Services
For a list of NFS related Booleans for other services:
/usr/sbin/semanage boolean -l | grep nfs
For a list of Samba related Booleans for other services:
/usr/sbin/semanage boolean -l | grep cifs

Note

These Booleans exist in SELinux policy as shipped with Red Hat Enterprise Linux 6. They may not exist in policy shipped with other versions of Red Hat Enterprise Linux or other operating systems.