- Network File System
- Allow sharing files over the network
- Developed as a standard protocol
- Used by *NIX and macOS
- Configuring an NFS Server
- Install NFS (if necessary)
yum install nfs-utils libnfsidmap
- Enable and Start Services
systemctl enable --now rpcbind nfs-server rpc-statd nfs-idmapd
- Create a folder to share
mkdir -pm 777 /export/share
- Add the folder to the export list
sudo vi /etc/exports
/export/share 10.0.0.0/16(rw,sync,no_root_squash)
- Reload the config file
sudo exportfs -r
-
sudo exportfs -v
to verify
- Allow clients through the firewall
firewall-cmd --permanent --zone public --add-service mountd
firewall-cmd --permanent --zone public --add-service rpc-bind
firewall-cmd --permanent --zone public --add-service nfs
firewall-cmd --reload
- Configuring an NFS Client
- Install NFS (if necessary)
yum install nfs-utils libnfsidmap
- Enable and Start rpcbind
systemctl enable rpcbind
systemctl start rpcbind
- Test if share is accessible
- Mount the share to a local folder
sudo mkdir /mnt/share
mount <server_ip>:/export/share /mnt/share
- (Optional) Add to fstab to mount during boot
sudo vi /etc/fstab
<server_ip>:/export/share /mnt/share nfs rw,sync,hard,intr 0 0
Explanation of NFS Options