NFS SERVER CONFIGURATION

=> NFS

Network File Sharing (NFS) is a protocol that allows you to share directories and files with other Linux clients over a network. Shared directories are typically created on a file server, running the NFS server component. Users add files to them, which are then shared with other users who have access to the folder.

=> Package = nfs-utils 

 => Default Port = 2049 

 => Configuration file : /etc/exports 

 => Steps for Configuration: 

 :- Install NFS Package 

 :- #yum intsall nfs-utils* 

 :- #systemctl restart nfs.service

=> Add NFS Service to firewall :

:- #firewall-cmd --zone=public --permanent --add-service=nfs

=> Add mountd service to firewall :

:- #firewall-cmd --permanent --add-service=mountd

=> Add rpc service to firewall :

:- #firewall-cmd --permanent --add-service=rpc-bind

=> Make a directory to share 

:- #mkdir /nfsserver

=> Change the permission of the Directory

:- #chmod 770 /nfsserver

=> Change the Owner of the Directory

:- #chown nfsnobody:root /nfsserver/

=> Add following line to Configuration file:

:- #vi /etc/exports

/nfsserver 192.168.0.11 (rw,sync)


Save and Exit 

=> Check The configuration 

:- #exportfs -avr


=> Go To Client Machine <=

=> Install NFS Package on the client machine

:- #yum install nfs-utils*

=> Check the connection from Server

:- #showmount -e 192.168.0.11


=> Temporary mount:

:- mount -t nfs -o sync 192.168.0.11:/nfsserver


=> Check mount

:- #df -h


=> Permanent Mount: 

:- #vi /etc/fstab

192.168.0.11:/nfsserver /media nfs default 0 0

Save and Exit

#mount a

=> Check mount

:- #df -h


Thanks..........




Comments

Popular posts from this blog

How to configure Mail Server in Redhat Linux

interview Questions on User Management in Linux

Kernel and Module Interview Questions