Close Menu
DPC Virtual Tips
    Read More

    How to Troubleshoot Packet Drops on an ESXi Host

    August 16, 2026

    SlurmDBD Is Down: What Continues Working and What Does Not

    August 15, 2026

    How to Investigate Jobs Stuck in COMPLETING State on Slurm

    August 14, 2026
    • Home
    • About Us
    • Contact
    • Cookie Policy
    • Comment Policy
    • Privacy Policy
    • Terms of Use
    • Disclaimer
    Tuesday, August 25
    DPC Virtual Tips
    • Home
    • Operating Systems
    • PowerFlex
    • HPC
    • Virtualization
    • About the Author
    • About Us
    • Contact
    DPC Virtual Tips
    Home » Working with Network File System (NFS) on RHEL 8
    Operating Systems

    Working with Network File System (NFS) on RHEL 8

    DaniloBy DaniloJuly 31, 2025Updated:August 1, 2026No Comments4 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    NFS on RHEL 8
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Network File System (NFS) is a widely used protocol for sharing files between Linux systems through a client/server architecture. In RHEL 8 environments, understanding how to configure and manage NFS is an essential skill for system administrators working with centralized storage and shared resources.

    In this guide, we will explore how to configure an NFS server and client on Red Hat Enterprise Linux 8. The examples cover installing required packages, creating export directories, configuring permissions, and mounting NFS shares across the network.

    NFS is a client/server protocol: The NFS server is responsible for providing shares, and the NFS client mounts these shares using the network.

    Prepare the NFS Server

    1- Update and install NFS components:

    dnf update -y 
    dnf install -y nfs-utils

    2- Create an NFS user, group, and an export directory:

    groupadd -r -g 65533 nfsnobody
    useradd  -r -u 65533 -g 65533 -d /nonexistent -s /sbin/nologin nfsnobody
    
    mkdir -p /srv/nfs/shared
    chown nfsnobody:nfsnobody /srv/nfs/shared
    chmod 755 /srv/nfs/shared

    3- Configure exports Edit /etc/exports and add:

    /srv/nfs/shared  *(rw,sync,no_root_squash)

    Let’s break down the line added to the /etc/exports:

    • /srv/nfs/shared This is the absolute path on the server that you’re sharing. Clients mounting this export will see the contents of this folder.
    • * Means that all clients (all IP addresses) are allowed to mount the NFS share. You can, for example, allow only clients within the subnet 192.168.10.0/24.
    • Export options:
      • rw Grants both read and write access. If you omit this, the share defaults to read-only (ro).
      • sync Forces the NFS server to confirm data is written to disk before replying. This guarantees consistency at the cost of some performance. The alternative (async) can be faster but risks data loss on a crash.
      • no_root_squash Allows the remote client’s root user to act as root on the exported directory. By default, NFS maps (or “squashes”) root to the anonymous user (root_squash), preventing privileged operations. Use no_root_squash with caution.

    4- Enable and start services:

    systemctl enable --now rpcbind nfs-server

    5- Apply exports:

    exportfs -ra

    6- Open all the necessary firewall ports (Open NFS, RPC bind, and mountd permanently):

    # Open NFS, RPC bind and mountd permanently
    firewall-cmd --permanent --add-service=nfs
    firewall-cmd --permanent --add-service=rpc-bind
    firewall-cmd --permanent --add-service=mountd
    
    # Reload to apply
    firewall-cmd --reload

    Note: Check if SELinux is enforcing:

    getenforce

    If it’s set to Enforcing, run the following command to allow NFS to export files:

    setsebool -P nfs_export_all_rw 1

    Prepare the NFS Client and Mount a NFS Share

    1- Install client utilities:

    dnf install -y nfs-utils

    2- Check all exports on the NFS server – In this case, for instance, the NFS Server IP is 192.168.255.164:

    showmount -e 192.168.255.164

    3- Manually mount the share:

    mkdir /mnt/nfs_share
    mount -t nfs 192.168.255.164:/srv/nfs/shared /mnt/nfs_share

    4- We can use the “mount” command to inspect details of the mounted filesystem:

    mount | grep -i -E "192.168.255.164"

    5- We can create some files to test the read/write access:

    6- Enable automatic mount at boot, add to /etc/fstab:

    192.168.255.164:/srv/nfs/shared  /mnt/nfs_share  nfs  defaults,_netdev  0 0

    7- Mount to test:

    mount -a

    NFS Server Export Options: no_root_squash and root_squash

    no_root_squash Allows the remote client’s root user to act as root on the exported directory. By default, NFS maps (or “squashes”) root to the anonymous user (root_squash), preventing privileged operations. Use no_root_squash with caution.

    So, if you don’t want to give the root privilege to the clients on that specific NFS share, let’s explore a way to fix it:

    1- We’ve created a user and group to use on the NFS server. To inspect it:

    cat /etc/passwd | grep -i "nfsnobody"
    cat /etc/group | grep -i "nfsnobody"

    In our example, the user and group ID is 65533:

    2- Edit the entry on /etc/exports, and adjust like the following – we’ve highlighted in red the changes that we’ve made:

    /srv/nfs/shared  *(rw,sync,root_squash,anonuid=65533,anongid=65533)

    With this configuration, all clients will be mapped to the specified user ID and group ID.

    3- Reload exports to apply the changes:

    exportfs -ra

    Now, when the root on the client is squashed to nfsnobody, it can create files.

    4- On the NFS client, it’s interesting to unmount and mount the NFS share and test the file creation.
    As we can see, the file “test4” was created in the NFS share and its user and group were defined based on the NFS server configuration:

    That’s it for now 🙂

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleResizing Filesystems on RHEL 8
    Next Article Overview of Linux Permissions on RHEL 8
    Danilo

    Infrastructure Engineer with experience in Virtualization, Linux, Windows Server and learning automation using Python. DPC Virtual Tips was created to share practical tutorials, lab experiences and troubleshooting guides focused on enterprise infrastructure technologies.

    Related Posts

    Linux Server Has Free Memory but Is Swapping: Why?

    August 13, 2026

    How to Determine Whether Packet Loss Is Local or Network Related on Linux

    August 12, 2026

    How to Investigate TCP Retransmissions on Linux

    August 11, 2026

    Comments are closed.

    Search
    Categories
    • HPC (12)
    • Operating Systems (85)
    • PowerFlex (22)
    • Virtualization (130)
    Read More
    Virtualization

    How to Troubleshoot Packet Drops on an ESXi Host

    By DaniloAugust 16, 20260
    HPC

    SlurmDBD Is Down: What Continues Working and What Does Not

    By DaniloAugust 15, 20260
    HPC

    How to Investigate Jobs Stuck in COMPLETING State on Slurm

    By DaniloAugust 14, 20260
    Operating Systems

    Linux Server Has Free Memory but Is Swapping: Why?

    By DaniloAugust 13, 20260
    Operating Systems

    How to Determine Whether Packet Loss Is Local or Network Related on Linux

    By DaniloAugust 12, 20260
    Latest Posts

    How to Troubleshoot Packet Drops on an ESXi Host

    August 16, 2026

    SlurmDBD Is Down: What Continues Working and What Does Not

    August 15, 2026

    How to Investigate Jobs Stuck in COMPLETING State on Slurm

    August 14, 2026
    Images from Gallery
    hpc main commands
    linux commands
    install rock linux
    lustre fs
    shell scripting
    vSAN Trace Files
    Categories
    • HPC
    • Operating Systems
    • PowerFlex
    • Virtualization
    • Home
    • About Us
    • Contact
    • Cookie Policy
    • Comment Policy
    • Privacy Policy
    • Terms of Use
    • Disclaimer
    Copyright © 2026, DPC Virtual Tips. All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.

    We use cookies to ensure your best experience on our website. If you continue using our website, we'll assume you agree to our cookie policy