Tutorial Configure Nfs
Tutorial Configure Nfs
Tutorial Configure Nfs
Ubuntu 22.04
By Darshita Daga & Sumit Patel --- On Jul 3, 2023
Install an NFS Server on Ubuntu 22.04 with our step-by-step tutorial. It enables file sharing
and data access between computers on a network.
NFS Server, or Network File System Server, is a powerful technology that enables file
sharing and data access between computers on a network. It allows multiple clients to
access files stored on a central server as if they were located on their own local machines.
NFS Server simplifies file management, improves collaboration, and enhances data
security. By providing a standardized protocol for file sharing, it enables seamless
interoperability across different operating systems and devices. With NFS Server,
organizations can efficiently manage their data, boost productivity, and foster
collaboration among team members.
In this tutorial, you will install and configure the NFS server on Ubuntu 22.04. We will also
address a few FAQs on how to install and configure NFS Server on Ubuntu 22.04.
©ms_anna/1-2023_2024
1
InstalI NFS server on Ubuntu 22.04
Follow the directions provided in order to install the NFS server on Ubuntu 22.04.
To install an NFS server, carry out the following command in the Ubuntu 22.04 terminal:
The shown output shows that the Ubuntu 22.04 "linuxuser" system has successfully
installed the NFS server:
Let's proceed to configuring the NFS server that has been installed.
First, a directory called "nfs_share" will be created and shared by all client systems.
Write the following command to do so:
Next, modify the "nfs_share" directory's permissions so that all client machines may
readily access it:
©ms_anna/1-2023_2024
2
Step 3: Set file permissions
Set the necessary file permissions. In our scenario, the "nfs_share" directory files have
been given the read, write, and execute permissions:
We will provide the client system permission to access the NFS server in this step.
Open /etc/exports in the nano editor to accomplish this:
You can now choose whether to provide access to a single client, a group of clients, or
the entire subnet. For instance, we'll allow 10.0.2.15/24 as a whole subnet to access the
NFS share:
/mnt/nfs_share 10.0.2.15/24(rw,sync,no_subtree_check)
Use CTRL+O to save the file after adding the necessary line, then return to the Ubuntu
22.04 terminal.
Make use of the command given to export the NFS shared directory:
sudo exportfs -a
Use the following command on your Ubuntu 22.04 machine to restart the NFS server:
Then, use the ufw command to allow the Firewall access to the client system:
©ms_anna/1-2023_2024
3
Step 8: Enable Firewall
Use the ufw command and the enable option to turn on the firewall:
Next, make sure the firewall is set up to permit access over port 2049:
To test the NFS sharing point, we will now proceed to the "ubuntuuser" system's NFS
client.
Mount the NSF share after that on the additional client system:
Now, we will create a few files in the nfs share directory on the linuxuser NFS server in
preparation for testing the NFS share on the client system:
cd /mnt/nfs_share/
touch sample1.text sample2.text
Go to the client system after that to see the list of files that are present in the
“nfs_clientshare” directory:
©ms_anna/1-2023_2024
4
ls -l /mnt/nfs_clientshare/
According to the output, the ubuntuuser client's successful use of an NFS server is shown
by the ability to access files:
The instructions for setting up, configuring, and testing an NFS server on Ubuntu 22.04
have been compiled by us.
Source: https://vegastack.com/tutorials/how-to-install-and-configure-an-nfs-server-on-
ubuntu-22-04/
©ms_anna/1-2023_2024
5