Este contenido no está disponible en el idioma seleccionado.

16.4. Configuration Examples


16.4.1. Enabling SELinux Labeled NFS Support

The following example demonstrates how to enable SELinux labeled NFS support. This example assumes that the nfs-utils package is installed, that the SELinux targeted policy is used, and that SELinux is running in enforcing mode.

Note

Steps 1-3 are supposed to be performed on the NFS server, nfs-srv.
  1. If the NFS server is running, stop it:
    [nfs-srv]# systemctl stop nfs
    Copy to Clipboard Toggle word wrap
    Confirm that the server is stopped:
    [nfs-srv]# systemctl status nfs
    nfs-server.service - NFS Server
       Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled)
       Active: inactive (dead)
    
    Copy to Clipboard Toggle word wrap
  2. Edit the /etc/sysconfig/nfs file to set the RPCNFSDARGS flag to "-V 4.2":
    # Optional arguments passed to rpc.nfsd. See rpc.nfsd(8)
    RPCNFSDARGS="-V 4.2"
    Copy to Clipboard Toggle word wrap
  3. Start the server again and confirm that it is running. The output will contain information below, only the time stamp will differ:
    [nfs-srv]# systemctl start nfs
    Copy to Clipboard Toggle word wrap
    [nfs-srv]# systemctl status nfs
    nfs-server.service - NFS Server
       Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled)
       Active: active (exited) since Wed 2013-08-28 14:07:11 CEST; 4s ago
    
    Copy to Clipboard Toggle word wrap
  4. On the client side, mount the NFS server:
    [nfs-client]# mount -o v4.2 server:mntpoint localmountpoint
    Copy to Clipboard Toggle word wrap
  5. All SELinux labels are now successfully passed from the server to the client:
    [nfs-srv]$ ls -Z filels -Z file
    -rw-rw-r--. user user unconfined_u:object_r:svirt_image_t:s0 file
    [nfs-client]$ ls -Z filels -Z file
    -rw-rw-r--. user user unconfined_u:object_r:svirt_image_t:s0 file
    Copy to Clipboard Toggle word wrap

Note

If you enable labeled NFS support for home directories or other content, the content will be labeled the same as it was on an EXT file system. Also note that mounting systems with different versions of NFS or an attempt to mount a server that does not support labeled NFS could cause errors to be returned.
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat