How to Configure NFS Server on Fedora Linux

What is NFS Server?

NFS (Network File System) is a protocol used for sharing files and directories over a network. It allows multiple systems to access the same files as if they were on the local system. An NFS server is a system running the NFS service, which exports (shares) one or more directories to clients over the network. To set up an NFS server on Linux, you need to install the NFS server package, configure the shared directories in the /etc/exports file, and start the NFS service. Clients can then use the mount command to access the shared directories. NFS is a versatile and widely used protocol, it’s important to apply appropriate permissions and security settings in production environments.

How to Configure NFS Server on Fedora Linux

To configure an NFS (Network File System) server on Fedora Linux, you will need to complete the following steps:

  1. Install the NFS server package. You can do this by running the following command:
sudo dnf install nfs-utils
  1. Start and enable the NFS service. You can do this by running the following commands:
sudo systemctl start nfs-server
sudo systemctl enable nfs-server
  1. Create a directory that will be shared over NFS. This can be any directory on your system. For example, you can create a directory called /nfs-share and make it owned by the nfsnobody user and group:
sudo mkdir /nfs-share
sudo chown nfsnobody:nfsnobody /nfs-share
  1. Edit the /etc/exports file to configure the shared directory. This file controls which directories are exported over NFS and what permissions are given to clients. To share the /nfs-share directory with read and write access for all clients, you can add the following line to the /etc/exports file:
/nfs-share *(rw,sync,no_root_squash)
  1. Reload the NFS server configuration. You can do this by running the following command:
sudo exportfs -a
  1. Firewall configuration:
sudo firewall-cmd --permanent --add-service=nfs
sudo firewall-cmd --reload
  1. You can test your NFS server by mounting the shared directory on another system. For example, you can use the mount command on a client system to mount the /nfs-share directory from the NFS server:
mount <server-IP>:/nfs-share <mount-point>
  1. Verify the exported file systems by using the following command:
showmount -e <server-IP>

Please note that this is a basic configuration and you might need to customize it according to your needs.

It’s also important to know that you should use appropriate permissions and security settings in production environments and that this configuration is only recommended for testing and learning purposes.

Visited 1 times, 1 visit(s) today

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top