Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How you configure a NFS server?

user-image
Question ajoutée par Faseeh Mohd koya , IT SUPPORT ENGINEER [L2] , Ministry of Sports and Youth
Date de publication: 2016/06/27
Ahmed Elshorbagy
par Ahmed Elshorbagy , Technical Support Engineer , AIMS Holding -Rinad Al Jazira for Military & Security Supplies.

Create the /etc/exports file. See /etc/exports file. If you are using NFS version 4, establish the NFS version 4 domain using the chnfsdom command. Initially, you can specify the server's internet domain in the file. It is possible, however, to define an NFS version 4 domain that is different from the server's internet domain. For clarification on this. If you are using NFS version 4 with Kerberos, you may need to create the /etc/nfs/realm.map file. If you want to use Kerberos authentication on the server, you must enable enhanced security on the server. You can enable enhanced security through using SMIT, or by using the chnfs -S -B command.

NFS quick start

Providing you understand what you are doing, use this brief walk-through to set up an NFSv4 server on Ubuntu (with no authentication security). Then mount the share on an Ubuntu client. It has been tested on Ubuntu 14.04 because am right now using ubuntu 14.0.4. 

 

NFS server

To check the NFS server is not installed, you can do...

  • $ dpkg -l | grep nfs-kernel-server

Install the required packages...

  • # apt-get install nfs-kernel-server

For easier maintenance we will isolate all NFS exports in single directory, where the real directories will be mounted with the --bind option.

  • Let's say we want to export our users' home directories in /home/users. First we create the export filesystem:

    # mkdir -p /export/users It's important that /export and /export/users have 777 permissions as we will be accessing the NFS share from the client without LDAP/NIS authentication. This will not apply if using authentication (see below). Now mount the real users directory with: # mount --bind /home/users /export/users To save us from retyping this after every reboot we add the following

    line to /etc/fstab

    /home/users /export/users none bind 00

There are three configuration files that relate to an NFS server: /etc/default/nfs-kernel-server, /etc/default/nfs-common and/etc/exports.

 

  • The only important option in /etc/default/nfs-kernel-server for now is NEED_SVCGSSD. It is set to "no" by default, which is fine, because we are not activating NFSv4 security this time.

More Questions Like This