In the /etc/exports file, add the configuration lines using the following syntax: export_directory1 client1(options) client2(options).clientN(options).Įxport_directory2 client1(options) client2(options).clientN(options).Įxport_directoryN client1(options) client2(options).clientN(options). The NFS configuration file is /etc/exports which determine which clients will have access to the exported directories. Next, we will configure NFS for the sharing of the export directories. Step 3: Configure and Share the NFS Exports The following output confirms that the /var/ nfs-share is now owned by nobody:nogroup. You can confirm the new owner through the following command: $ ls -la /var/ nfs-share Run the following command to change the ownership of /var/ nfs-share directory from root to nobody:nogroup: $ sudo chown nobody:nogroup /var/nfs-share We will not change the ownership of the second directory it will remain owned by the root user. You can verify it by running the ls commands as follows: $ ls -la /var/nfs-share $ ls -la /var/nfs-share1įrom our two export directories ( /var/ nfs-share and /var/ nfs-share1), we will change the ownership of one of the directory /var/ nfs-share to nobody:nogroup. Run the following commands with sudo to do so: $ sudo mkdir -p /var/nfs-share $ sudo mkdir -p /var/nfs-share1Īs these directories were created with sudo, therefore the root user currently owns them. First, we will have to create these directories. Let’s say we want to export two directories /var/nfs– share and /var/nfs-share1. On the server machine, create an export directory you want to share with the clients. If you see the below similar output, it shows the NFS server has been installed successfully. Hit y to continue the installation.Īfter the installation is completed, you can verify it by running the following command in Terminal: $ dpkg -l | grep nfs-kernel-server
Then install nfs-kernel-server package as follows: $ sudo apt install nfs-kernel-serverĪfter running the above command, the system will prompt with the y/n option. First, update the local repository index: $ sudo apt update On the machine to be setup as an NFS server, you will need to install nfs-kernel-server. Setting up NFS server Step 1: Install NFS Server
This post will be about how to configure the NFS server and client on Linux Mint 20.įor the demonstration, we will be using the two machines with the following details: In our previous post, we shared with you how to configure the NFS client and server on the Debian system. NFS (Network File System) works in the form of a client-server model where the machine sharing the directories is known as the NFS server whereas the machine accessing those directories is known as the NFS client.