DEV Community

Shaikh Al Amin
Shaikh Al Amin

Posted on • Updated on

Create a Network File Share(NFS) in ubuntu machine and use it in your local machine

// Install NFS server on other machine

sudo apt-get update
sudo apt-get install nfs-kernel-server
Enter fullscreen mode Exit fullscreen mode

Update the etc exports:
Update the below home directory path which you want to share.

sudo nano /etc/exports
/home/jobayeer/Desktop/shared   *(rw,sync,no_subtree_check)
Enter fullscreen mode Exit fullscreen mode

*Now update all exports and allow from all host for now: *

sudo exportfs -a
Enter fullscreen mode Exit fullscreen mode

Edit allow hosts config like below:

sudo nano /etc/hosts.allow
ALL: ALL
Enter fullscreen mode Exit fullscreen mode

Now restart the server:

sudo systemctl start nfs-kernel-server
Enter fullscreen mode Exit fullscreen mode

*Use it on your own machine : *

sudo apt-get update
sudo apt-get install nfs-common

sudo mkdir /mnt/nfs_share


sudo mount 192.168.2.56:/home/jobayeer/Desktop/shared /mnt/nfs_share
Enter fullscreen mode Exit fullscreen mode

Top comments (0)