vi /etc/exports
/home1 MyClient(ro,sync,no_subtree_check)
/usr/sbin/exportfs -a
NFS Client
apt install nfs-common
vi /etc/hosts
(Add the IP address of MyServer)
ping -c 5 MyServer
On MyServer,
echo Apple > /home1/aaa.txt
On MyClient,
mount -t nfs MyServer:/home1 /mnt
ls /mnt
cat /mnt/aaa.txt
On MyServer
Edit /etc/exports. Change the option "ro" to "rw".
exportfs -a
chmod 777 /home1
Now MyClient can write files into that directory:
echo Banana > /mnt/bbb.txt
ls -l /mnt/bbb.txt
You see the UID:GID is changed to nobody:nobody.
This is the default security mechanism to prevent the root user
on another host creating a file with a high privilege. How people
may exploit that to hack your system is beyond the scope of this
tutorial.
Your client would certainly want to mount the file system at a
permanent mounting point instead of /mnt.