NFS Server Configuration RHEL 7 / Cent OS 7

Using NFS server will share the files/ Directories over the network.
Using this service will install operating system and access the remote server directory/file to read/write files and will share the file/directory to other machines.

Required Package:


Installing NFS packages:

Use the below command to install all the required packages in one shot.

#yum install nfs*


Check whether the packages are installed by executing below command

[root@server ~]# rpm -qa | grep nfs

Important configuration files:

/etc/exports :                This file contains which all are exported to remote                                                                 machines 
/etc/host.allow :           Daemon/ Client which matches the entry available in                                                        this file, will be granted access.
/etc/host.deny :           Access is denied for daemon/ client which matches in                                                     this file.
/etc/fstab :                      Will mount the shared directories/ filesystems                                                                   permanently using this file.
/etc/sysconfig/nfs:  Will manage the nfs port using this file.

Services which need to be enabled and started:

rpcbind  service
nfs-server  service

Command to enable the services:

#systemctl enable rpcbind
#systemctl enable nfs-server

[root@server ~]# systemctl enable rpcbind
[root@server ~]# systemctl enable nfs-server
Created symlink from /etc/systemd/system/ to /usr/lib/systemd/system/nfs-server.service.

Command to start the services:

#systemctl start rpcbind
#systemctl start nfs-server

[root@server ~]# systemctl start nfs-server

[root@server ~]# systemctl start rpcbind

create directory for sharing:

[root@server ~]# mkdir /nfshare

set the all permission to all

#chmod 777 /nfshare

Now share the directory using NFS by mentioning the directory details in /etc/exports file

#vi /etc/exports


save and exit from the file

Now use the below command to make it available in network as a shared directory

[root@server ~]# exportfs -r

Enable the services permanently in firewall in this session

[root@server ~]# firewall-cmd --permanent --zone public --add-service  mountd
[root@server ~]# firewall-cmd --permanent --zone public --add-service rpc-bind
[root@server ~]# firewall-cmd --permanent --zone public --add-service nfs

reload the firewall  changes and make effect in this session by executing below command

[root@server ~]# firewall-cmd --reload


Now all the configuration has been done in server side and have to check and mount the shared directory in client machine.

showmount command will help us to list the directory which is shared from remote machine.

[root@node1 ~]# showmount -e
Export list for
/nfshare *

Now we need to mount the shared directory in client. Before that we should create a directory to use that as a mount point.

[root@node1 ~]# mkdir /nfsmount

Mount the directory temporarily

#mount  /nfsmount

Mount permanently by editing /etc/fstab file and make entry

#vi /etc/fstab /nfsmount nfs rw,sync 0 0

save and exit from the file.

unmount the directory because we mounted temporarily before restart and after restart issue mount to check whether the shared directory is listing or not. If its not listing then there is an issue with entry in /etc/fstab file.

#umount /nfsmount

Restart the client and check using mount command

[root@node1 ~]# mount | grep /nfsmount on /nfsmount type nfs (rw,sync,vers=4,addr=,clientaddr=

7 thoughts on “NFS Server Configuration RHEL 7 / Cent OS 7”

  1. Hello,I read your new stuff named “NFS Server Configuration RHEL 7 / Cent OS 7 –” daily.Your writing style is witty, keep doing what you’re doing! And you can look our website about تحميل افلام.

  2. After you do have a farm or two with seeds planted, you should create some chests to hold your
    items as part of your house. The 1st branch is going to be
    where the sail starts and the 2nd branch where it enxs – Step
    24: Addd the sail, maske an effort to build it which
    has a curve tjen it provides the impression of getting wind behind it.
    The game is a thing that could enable people to be excited
    for the long time along with the quantity oof different components players should
    find on the game is amazing.

Leave a Reply

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