Install NFS Server and Client in CentOS 7 and Redhat 7

0
8342

NFS (Network File System) is the popular distributed filesystem protocol. It’s better for users to mount remote folders on their local servers. Here, we will explain step by step how to create NFS server and how to mount the shared directories from the NFS clients.

My test systems are CentOS 7.4 with the following info:

NFS Server = 192.168.178.31
NFS Client = 192.168.178.32

I-Install NFS Utils

“nfs-utils” includes all the needed services to build your NFS server. Let’s install it with the following commands:

Now, create the directory for NFS service to share:

Change the permissions of the shared folder:

Let’s enable and start the services to make “nfs_share” accessible later and make them bootable on the next reboot.

We will configure NFS directory over the network with the next step:

and add

192.168.178.32 is the IP of NFS client machine. If you wish to all local network, use 192.168.178.0/24  or  “*” to allow connection from everywhere.

Restart the NFS service:

Here, add the rules below to allow the connection through the NFS service:

Before installing NFS clients, you need to share the folder.

II-Install  NFS Client

Run the same command to install all the needed NFS packages.

Create the NFS directory mount points:

Next, we will mount the NFS shared directory on the client machine as shown below:

We are connected. Now, you have the reading and writing access to the remote folder.

To mount this folder automatically on every boot, please add this line to “/etc/fstab”

Enjoy! Please come back to us if you have any comment, question or suggestion.

Spread the love
  • 8
    Shares

PS. If you like this post please share it with your friends on the social networks using the buttons above.Thanks.

LEAVE A REPLY

Please enter your comment!
Please enter your name here