OverView
Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems (Sun) in 1984, allowing a user on a client computer to access files over a computer network much like local storage is accessed. NFS, like many other protocols, builds on the Open Network Computing Remote Procedure Call (ONC RPC) system. NFS is an open IETF standard defined in a Request for Comments (RFC), allowing anyone to implement the protocol.
NFS installation
install nfs server kernal
sudo apt update
sudo apt install nfs-kernal-server -y
create a share directory
# ~/ desktop
mkdir ~/Desktop/nfs
#change permission
sudo chown nobody:nogroup ~/Desktop/nfs
#add world writable permission
sudo chmod 777 ~/Desktop/nfs
enable share
edit /etc/exports
#added this line
# this is for network CIDR
/home/anir0y/Desktop/nfs {IP}/{subnet}(rw,sync,no_subtree_check)
# example:
/home/anir0y/Desktop/nfs 192.168.29.0/24(rw,sync,no_subtree_check)
restart NFS service
# enable shares
sudo exportfs
# restart the service
sudo systemctl restart nfs-kernel-server.service
Client side config
install nfs client
sudo apt update
sudo apt install nfs-common -y
Enum share
showmount -e {iP}
mount network share
# make a mounting dir
mkdir ~/nfsclient
#mounting
sudo mount -t nfs {IP}:{folder} {local_path}
#e.g.
sudo mount -t nfs 192.168.29.83:/home/anir0y/Desktop/nfs ~/nfsclient