How to Setup NFS (Network File System) on RHEL/CentOS/Fedora and Debian/Ubuntu

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Tarunika Shrivastava

I am a linux server admin and love to play with Linux and all other distributions of it. I am working as System Engineer with a Web Hosting Company.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

89 Responses

  1. Shyam says:

    Very useful explanation was awesome

  2. Jyoti Sinha says:

    Very clearly explained..
    Thank you so much..for your Help

  3. Sri Ram says:

    commands must be running on the server if you are building a network file system?

  4. Sri Ram says:

    Which of the Commands must be running on the server if you are building a network file system?

    • Ravi Saive says:


      Please follow the instructions carefully, as we’ve already mentioned which commands should be run on Server and Client..

  5. Saeed says:

    Hi this really worked but one thing is missing we need to start the nfs service on both the node with the below command.

    # service nfs start
    Starting NFS services:                                     [  OK  ]
    Starting NFS quotas:                                       [  OK  ]
    Starting NFS daemon:                                       [  OK  ]
    Starting NFS mountd:                                       [  OK  ]

    Once this status is OK then we can see the mount points in nfs client..

  6. tarun says:

    i got acess denied by the server while mount …..
    How to resolve this ..?

  7. anupriya says:

    very very very clearly explained..
    thank you so much..keep up the good work

  8. msp says:

    can u plese explain about the no_root_squash and root_quash with some real time example… im little bit confused with it

    • krish says:

      By default, NFS shares change the root user to the nfsnobody user, an unprivileged user account. In this way, all root-created files are owned by nfsnobody, which prevents uploading of programs with the setuid bit set.
      If no_root_squash is used, remote root users are able to change any file on the shared file system and leave trojaned applications for other users to inadvertently execute.

  9. Shay Tomas says:


    Would this work to mount an entire raid from one Red Hat Server to an Ubuntu server? How can I mount the entire raid volume? Thanks!


    what should be the entry of fstab for mounting the nfs share directory using user name and password

    • Ravi Saive says:


      To mount nfs share with username and password in Linux, you should add following entry in your fstab file. /mnt nfs user=administrator,password=pass 0 0

      And don’t forget to change above values as per your requirements.

Got something to say? Join the discussion.

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