Skip to content

NFS Protocol

For security reasons this is not recommended for unexperienced users.

The eManager runs a NFS server. This allows remote file navigation through your PC file manager.

Setting up a NFS server (steps to follow on an eManager)

In this example we expose the eManager folder /srv/nfs/emanager_shared to the NFS protocol.

  1. Open an eManager terminal with Internet connection and type

    opkg update
    opkg install nfs-utils
    

  2. Choose a folder to be shared. In this example we choose /srv/nfs/emanager_shared. Create it if it doesn't exist.

    mkdir -p /srv/nfs/emanager_shared
    

  3. Add the absolute path to /etc/nfs-utils.conf as follows. Open the file

    nano /etc/nfs-utils.conf
    
    and edit the PROCNFSD_MOUNTPOINT field.
    #...
    #Where to mount nfsd filesystem; the default is "/proc/fs/nfsd".
    PROCNFSD_MOUNTPOINT="/srv/nfs/emanager_shared"
    #...
    

  4. Edit /etc/exports

    echo '/srv/nfs/emanager_shared    *(rw,root_squash)' >> /etc/exports
    

  5. Enable and restart the nfs server

    systemctl enable nfs-server
    systemctl restart nfs-server
    

  6. Add permissions to the folder. In this case, only read permissions are given:

    chmod 555 /srv/nfs/emanager_shared
    

Permissions

Files and folders in /srv/nfs/emanager_shared may miss read permissions when accessed from PC. Execute chmod 555 -R /srv/nfs/emanager_shared at the eManager terminal in order to recursively add permissions to the whole folder tree under /srv/nfs/emanager_shared. It may be necessary to execute this command every time new files are added by the eManager user or system.

Now /srv/nfs/emanager_shared should be accessible via NFS.

How to stop the NFS server

Stop the NFS server in the eManager with

systemctl disable nfs-server
systemctl stop nfs-server

Setting up a NFS client (steps to follow on a PC)

In this section the steps that must be followed to access a NFS server from a PC are detailed for different operating systems.

  1. Install nfs-common packages. This step may vary depending on your package manager. The following commands should work on any Debian-based distros such as Ubuntu, MX Linux or Deepin.

    sudo apt update
    sudo apt install nfs-common
    

  2. Choose a place in your PC to mount the shared directory. In this example we placed it at /mnt/client_sharedfolder

    sudo mkdir -p /mnt/client_sharedfolder
    

  3. Connect the PC to the eManager, either using Ethernet or WiFi eManager Hotspot.

  4. Mount the folder

    sudo mount [SERVER]:/[NFS_export] [Local_mountpoint]
    
    where

    Field Description Examples
    SERVER Either IP address to eManager
    or
    hostname.local
    eManager-Pro-ABCDEF.local
    emanager-pro-abcdef.local
    192.168.137.1
    NFS_export Absolute path to the shared directory on
    the eManager system
    /srv/nfs/emanager_shared
    Local_mountpoint Mount point directory on the PC /mnt/client_sharedfolder/

    In our example it looks like

    sudo mount eManager-Pro-ABCDEF.local:/srv/nfs/emanager_shared /mnt/client_sharedfolder/
    
    The content of /srv/nfs/emanager_shared from the eManager should be visible at /mnt/client_sharedfolder in your PC.

  1. Choose a place in your Mac to mount the shared directory. In this example we placed it at /private/nfs/client_sharedfolder

    sudo mkdir -p /private/nfs/client_sharedfolder
    

  2. Connect the Mac to the eManager, either using Ethernet or WiFi eManager Hotspot.

  3. Open a terminal on your Mac and mount the remote folder

    sudo mount -o rw,bg,hard,resvport,intr,noac,nfc,tcp [SERVER]:/[NFS_export] [Local_mountpoint]
    
    where

    Field Description Examples
    SERVER Either IP address to eManager
    or
    hostname.local
    eManager-Pro-ABCDEF.local
    emanager-pro-abcdef.local
    192.168.137.1
    NFS_export Absolute path to the shared directory on
    the eManager system
    /srv/nfs/emanager_shared
    Local_mountpoint Mount point directory on the PC /private/nfs/client_sharedfolder

    In our example this looks like

    sudo mount -o rw,bg,hard,resvport,intr,noac,nfc,tcp eManager-Pro-ABCDEF.local:/srv/nfs/emanager_shared /private/nfs/client_sharedfolder
    
    The content of /srv/nfs/emanager_shared from the eManager should be visible at /private/nfs/client_sharedfolder in your Mac. It also should be visible at the Computer window (while in Finder press Shift+Cmd+C).

Keep in mind

The mount step is persistent on eManager reboots. However, the mount command should be executed on every PC/Mac boot.

To unmount the shared folder type in your PC use sudo umount /mnt/client_sharedfolder/.