Moreover, you can setup the firewalls in your NFS server to make the data private and highly secure. However, the beginners always look for simple ways to setup an NFS server in Linux distros like Fedora. In this guide, we will explain a brief method to install and setup an NFS server on Fedora Linux.
How to Install and Setup the NFS Server on Fedora Linux
Let’s divide this section into multiple parts to first explain the installation of the required packages and then setup the NFS server.
Additional Package Installation
First, update the system as per the latest updates available for Fedora Linux.
Now, you can install the NF utility by running the following command in the terminal:
Configure the NFS Server
It is time to create a directory which we will share over the network. Choose a location for your shared directory and create it using this command:
Now, you can edit the “/etc/exports” file to configure the NFS server.
In the editor, add an entry to specify the directory that you want to share. For example, to allow an access to the “/My_Directory” directory from all clients, add the following line:
In the previous command, “rw” stands for the read-write permission, and the no_root_squash allows the clients to use the root privileges. The asterisk (*) allows any client to access the shared directory.
You can also export the My_Directory to a specific client. For example, let’s provide an access to My_Directory to the client that has the 101.060.10.111 IP address.
Now, export the shared directory and then start and enable the NFS server.
sudo systemctl start nfs-server
sudo systemctl enable nfs-server
sudo systemctl status nfs-server
Adjust the firewall settings to allow the NFS traffic by executing the following commands:
Finally, reload the firewall service to make sure that everything is running fine.
Conclusion
You successfully setup an NFS server on your Fedora Linux machine. NFS provides a convenient and efficient method for collaborative file sharing which allows for seamless data exchange among the connected devices. From the NFS server up, you can now enjoy the benefits of the centralized file management and enhanced productivity in your networked environment.