NFS (Network File System) is basically developed for sharing of files and folders between Linux/Unix systems by Sun Microsystems in 1980. It allows you to mount your local file systems over a network and remote hosts to interact with them as they are mounted locally on the same system. With the help of NFS, we can set up file sharing between Unix to Linux system and Linux to Unix system.

Hello dosto,  Technicalhariji me apka ek baar phir se swagat hai. Dosto aaj hum baat karne wale hai NFS(Network File System) ke bare me. Aur sath hi jante hai ki NFS ko Kaise Configure karna hai.

Dosto NFS RHCE Exam ka hi ek Question hai. To me aaj apko is question ko Step by Step Solve karke dikhane wala hu. Aur sath hi yha par me apko NFS ki PDF bhi dunga jise Download kar aap kar sakte ho.

Importance Files for NFS Configuration

  • /etc/exports : Its a main configuration file of NFS, all exported files and directories are defined in this file at the NFS Server end.
  • /etc/fstab : To mount a NFS directory on your system across the reboots, we need to make an entry in /etc/fstab.
  • /etc/sysconfig/nfs : Configuration file of NFS to control on which port rpc and other services are listening.

Server Hostname= Server0.example.com

Desktop Hostname= Desktop0.example.com

Server IP = 172.25.0.11

Desktop IP = 172.25.0.10

Configure NFS on Server Machine:

  • Firstly hume NFS  Configure karne ke liye package ko Install karna hoga.
#  yum -y install  nfs*
  • Ab Directory Create karna hai jise hum Share karenge.
# mkdir /public
# mkdir /private
  • Ab hum Selinux se NFS ko Permission denge.
# Semanage fcontext -a -t public_content_t '/public(/.*)?'

# Semanage fcontext -a -t public_content_rw_t '/private(/.*)?'

# restorecon -vvFR  /private
  • Yha par hume Key is Link se key Download kar lena hai.
# wget -O /etc/krb5.keytab   http://classroom.example.com/pub/keytabs/server0.keytab
  • Is File me jana hai aur new Version Entry karni hai.
# vim /etc/sysconfig/nfs
RPCNFSDRAGS="-V 4.2"  =========> Entry
  • Ab hume Exports file me Entry karni jis Directory ko hum share karna chahte hai.
# vim /etc/exports
/public                       172.25.0.0/24(ro) =================> Entry
/private                     172.25.0.0/24(rw,sync,sec=krb5p) ============> Entry
# lab nfskrb5 setup                      ==============(For Foundation Machine)
  • Service ko Restart aur Enable kar dena hai.
# systemctl restart nfs-server
# systemctl enable nfs-server
  • Firewall se NFS ko permission dena hai.
# firewall-cmd --permanent --add-service=nfs
# firewall-cmd --complete-reload
  • Then iske baad ek Directory aur create karni hai jise kerberos se Protect karna hai.
# mkdir /private/project
  • Ab ek User Create karna hai.
# useradd harry
# chown nfsnobody /private
# chown harry /private/project
# setfacl -m u:harry:rwx /private/project
  • Ab Service ko Restart kar dena hai.
# systemctl restart nfs-secure
# systemctl enable nfs-secure
# systemctl restart nfs-secure-server
# systemctl enable nfs-secure-server
  • nfs-secure ko firewall se permission dena hai.
# firewall-cmd --permanent --add-service=rpc-bind
# firewall-cmd --permanent --add-service=mountd
# firewall-cmd --complete-reload
  • Check karne ke liye cmd.
# exportfs -r
# exportfs

Configure NFS on Desktop machine


  • Firstly Package install kar lena hai.
# yum -y install nfs* cifs*
  • Key download kar lena hai.
# wget -O /etc/krb5.keytab  http://classroom.example.com/pub/keytabs/desktop0.keytab
  • Directory create kar lena hai jisme aapko Share ki gyi Directory ko Mount karna hai.
# mkdir /mnt/nfsmount
# mkdir /mnt/nfssecure
# lab nfskrb5 setup
  • FStab file me Entry kar Dirctory ko permanent mount kar dena hai.
# vim /etc/fstab
server0:/public                  /mnt/nfsmount          nfs        defaults          0         0               =========> Entry
server0:/private               /mnt/nfssecure           nfs        defaults,sec=krb5p,v4.2           0       0 =========> Entry
  • Service ko Restart aur Enable kar dena hai.
# systemctl restart nfs-secure
# systemctl enable nfs-secure
  • Mount karne ke liye Cmd run karana hai.
# mount -a
  • Mount Check karne ke liye CMD.
# df -h
Complete NFS Configuration.

Mount -a cmd chalane ke baad apko df -h cmd run karana hai aur yha par jo directory hum ne share kiye the vo aa jate hai to NFS complte hua aur fhir bhi koi problem hai to PDF download kar sakte hai.


==================Download NFS PDF====================

I hope apko ye post pasand ayi hogi aur agr pasand hai to please apne Friend ke sath share jrur kare aur abhi tak apne humare blog ko subscribe nhi kiya hai to subscribe jrur kar le kyunki me aisi post apke liya lata rehta hu jisse ki sabse pehle update apko hi mile.

Thank You

LEAVE A REPLY

Please enter your comment!
Please enter your name here