How to install, configure NFS server and client in RedHat Linux

This tutorial demonstrates the installation and configuration of NFS on two RHEL 9 servers, one acting as a server and the other as a client.

On the NFS server:

Install the NFS utilities package

Enable and start NFS & rpcbind services

systemctl start nfs-server

systemctl start rpcbind

Create a directory to share

Edit the /etc/exports file and add the following line

172.31.27.0 – Client IP

/nfs/shared – Directory on server that is being shared

no_root_squash – Allows the root user on the client machine to have root privileges on the shared directory.

Apply the configuration

On the NFS client:

Install the NFS utilities package

Allow the following ports on the EC2 security group

Verify if the client can access the share

Create mount point on the client machine and mount the shared directory

Verify the mount

Add the following line in /etc/fstab for persistent mounting

By Mahesh

Leave a Reply

Your email address will not be published. Required fields are marked *