Debian / Ubuntu Linux: Setup NFSv4 File Server

www.la‮u‬tturi.com
Debian / Ubuntu Linux: Setup NFSv4 File Server

To set up an NFSv4 file server on Debian or Ubuntu Linux, you will need to install the nfs-kernel-server package and configure the NFS server settings. Here are the steps to set up an NFSv4 file server on Debian or Ubuntu:

  1. Install the nfs-kernel-server package. Use the apt-get command to install the nfs-kernel-server package:
sudo apt-get install nfs-kernel-server
  1. Configure the NFS server settings. The NFS server settings are stored in the /etc/exports file. Edit this file and add the directories that you want to export as NFS shares. For example:
/export/data 192.168.1.0/24(rw,sync,no_root_squash,no_subtree_check)

This will export the /export/data directory to clients with IP addresses in the 192.168.1.0/24 range, with read-write permissions and the sync option enabled.

  1. Export the directories. Use the exportfs command to export the directories that you added to the /etc/exports file:
sudo exportfs -a
  1. Start the NFS server. Use the systemctl command to start the NFS server:
sudo systemctl start nfs-kernel-server
  1. Enable the NFS server to start automatically at boot. Use the systemctl command to enable the NFS server to start automatically at boot:
sudo systemctl enable nfs-kernel-server

By following these steps, you should be able to set up an NFSv4 file server on Debian or Ubuntu Linux. You can then mount the NFS shares on client systems using the mount command. For more information on configuring and using NFS on Debian or Ubuntu, you can refer to the documentation and man pages for the nfs-common and nfs-kernel-server packages.

Created Time:2017-10-28 14:02:26  Author:lautturi