cybrkyd

File sharing using NFS

 Sun, 12 Oct 2025 17:04 UTC

According to me, NFS wins hands down every time when it comes to file sharing between Linux PCs. The setup configuration is minimal and in less than 60 seconds, two Linux boxes can be talking nicely to each other. Importantly, it is super stable in comparison to Samba, et al. I have never ever seen NFS break.

Here is my cheat sheet for setting up NFS sharing between my Linux PCs.

  1. Install NFS
    Open a terminal and install NFS server:

    sudo apt install nfs-kernel-server
    
  2. Configure NFS
    Edit the NFS exports file:

    sudo nano /etc/exports
    

    Add the following line to share a specific folder:

    /path/to/shared/folder <IP address of the other PC>(rw,sync,no_subtree_check)
    
  3. Export the Shared Directory
    Run the following command to export the shared directory:

    sudo exportfs -a
    
  4. Start NFS Service
    Ensure the NFS service is running:

    sudo systemctl start nfs-kernel-server
    
  5. Open the NFS port to one specific IP
    Expose the NFS default port 2049 to one specific LAN IP address only:

    sudo ufw allow from <IP address of the other PC> to any port 2049
    
  6. Access the Shared Folder
    On the other Linux PC, mount the shared folder:

    sudo mount <IP address of the first PC>:/path/to/shared/folder /mnt
    

    You can now access the shared files in the /mnt directory.

    To unmount the shared folder:

    sudo umount /mnt
    
»
Tagged in: #linux #NFS #filesharing

Visitors: Loading...