Ubuntu Linux NFS Server installation and Configuration

Ubuntu Linux NFS Server installation and Configuration

To install and configure an NFS (Network File System) server on Ubuntu Linux, follow these steps:

  1. Install the NFS server packages:
sudo apt-get update
sudo apt-get install nfs-kernel-server
Source‮www:‬.lautturi.com
  1. Create the directories you want to share over NFS. For example, to create a shared directory called /srv/nfs, run the following command:
sudo mkdir -p /srv/nfs
  1. Set the correct permissions on the shared directory. For example, to give read and write access to the nfsuser user and the nfsgroup group, run the following command:
sudo chown nfsuser:nfsgroup /srv/nfs
sudo chmod 775 /srv/nfs
  1. Edit the /etc/exports file to configure the NFS exports (shared directories). Add a line for each directory you want to share. For example, to share the /srv/nfs directory with read and write access to the IP address 192.168.1.100, add the following line to the /etc/exports file:
/srv/nfs 192.168.1.100(rw,sync,no_subtree_check)
  1. Restart the NFS server to apply the changes:
sudo systemctl restart nfs-kernel-server
  1. On the client machine, install the NFS client packages:
sudo apt-get update
sudo apt-get install nfs-common
  1. Create a mount point for the NFS share on the client machine. For example, to create a mount point called /mnt/nfs, run the following command:
sudo mkdir -p /
Created Time:2017-10-30 14:27:26  Author:lautturi