Configuration of NFS Server stands for Network File System which used to share the files and folders between Unix/Linux machine over the network. We can configure and mount the NFS share point using the command on Linux.
Benefits of NFS Server:
1. It allows local access to remote files
2. We can secure this with firewalls and Kerberos
3. The operating system is not necessary to be the same.
Port Number – 2049 for TCP/UDP
File Location – /etc/exports
Packages need to be installed are nfs-utils and portmap
Configuration of NFS Server To Share files & Directories:
Portmap – It maps calls made from another machine to connect RPC Service. In version 4, it’s not required.
Check Out: Enable/Disable Firewall
On Server Side,
Install Packages nfs-utils
Define the NFS location in /etc/exports and make a directory called testing.
Change domain in /etc/idmadp.conf
Start the Service
systemctl start rpcbind nfs-server
Also, run exportfs -a
On Client Side,
Also, install the Packages mentioned above in the post and start the service. Now testing, Create a directory on client-side in the Working folder to test.
Run the below command to mount the NFS share
mount -t nfs nfs-server-ip:/location-of-directory-made current-mount-location
Don’t forget to add the port in the firewall,
firewall-cmd --permanent --add-port=2049/tcp firewall-cmd --reload
And you can see, Data getting stored on NFS directory Server.
That’s it nfs command in linux mount on configure