We're here to assist with any of your needs, don't hestitate to reach out.
NFS (Network File System) is a distributed file system protocol that allows you to share files and directories between multiple Linux or Unix-like systems over a network. It enables you to access remote files as if they were on your local system.
To install NFS on CentOS 8, follow these steps:
sudo dnf update
sudo dnf install nfs-utils
sudo systemctl start nfs-server
sudo systemctl enable nfs-server
The NFS server is now running on your system.
sudo mkdir /mnt/nfs_share
sudo chown nobody:nobody /mnt/nfs_share
sudo chmod 777 /mnt/nfs_share
sudo nano /etc/exports
Add the following line to the file:
/mnt/nfs_share *(rw,sync,no_subtree_check)
Save and close the file.
sudo exportfs -a
sudo firewall-cmd --add-service=nfs --permanent
sudo firewall-cmd --reload
If you want to allow specific client systems to access the NFS server, you can specify their IP addresses or hostnames in the /etc/exports file. For example:
/mnt/nfs_share client1.example.com(rw,sync,no_subtree_check)
/mnt/nfs_share 192.168.0.100(rw,sync,no_subtree_check)
Save the file and export the changes by running sudo exportfs -a
.
sudo mkdir /mnt/nfs_client
sudo mount nfs_server_ip:/mnt/nfs_share /mnt/nfs_client
Replace nfs_server_ip with the IP address of the NFS server.
You have successfully installed and configured NFS on CentOS 8. Now you can access the shared directory on the client system.
What our customers say about us
Create your free account today.