How to access files on NAS via NFS from UNIX/Linux clients?


最后修订日期: 2022-08-11

This tutorial guides you to setup your NAS to be accessed via NFS from UNIX/Linux clients in the local network. The first step is to enable the NFS service on NAS.

Enable NFS Service

  1. Open Control Panel and navigate to Network & File Services > Win/Mac/NFS

img

  1. Click NFS Service tab in the new window and tick the option to enable NFS v2/v3 and/or NFS v4

img

  1. Click Apply button to apply and save the settings After the service is enabled, the next step is to setup NFS host access. [back to top]

Setup NFS host access

  1. Click on the link “Click here to set the NFS access right of the network share”. You will be taken to the Shared Folders menu.

img

  1. Under the Action column, please click on the icon of Edit Shared Folder Permission

img

  1. In next window, select NFS host access under Select permission type img

  2. NFS access right is disabled by default, here you can enable it first img

  3. Click the Add button to add Host / IP / Network and to set their permissions img

  4. Click Apply button to apply and save the settings


Allowed IP Address or Domain Name

  1. Single server: A valid domain name, host name, or IP address that can be resolved by a DNS server.

  2. Use wildcard characters to specify a series of servers: Use “*” or “?” to specify the string criteria. When you use wildcard characters in a valid host name, dot (.) is not included in wildcard characters. For example, when you enter *.example.com, one.example.com is counted while one.two.example.com is not counted.

  3. IP network: Use a.b.c.d/x. a.b.c.d refers to the network and x refers to number of bits of the network mask, for example, 192.168.0.0/24. Another valid format is a.b.c.d/network mask. In this case, a.b.c.d refers to the network and the following value refers to the network mask setting. For example, 192.168.100.8/255.255.255.0.

  4. If using IPv6, enter the IP address and prefix length (ex: 2001::208:9bff:feed:5023/64) for filtering devices and permission settings. If the prefix length is not set, it will refer to a single host IP.

  5. Network group: Represented as @group-name; group-name refers to the name of NIS network group.

    Note: Please make sure the format you entered is correct. An incorrect format can lead to access errors.

Here are some examples and figures to explain more about the host access settings

  1. Configure ✱ in Host / IP / Network field to allow accessing the shared folder from all client IP addresses

img

    1. Configure the full IP address in Host / IP / Network field to allow accessing the shared folder from the dedicated client IP address (ex: 192.168.1.33)
    2. Configure the IP network in Host / IP / Network field to allow accessing the shared folder from certain client IP networks (ex: 192.168.1.0/24)
    3. Configure the hostname in Host / IP / Network field to allow accessing the shared folder from certain client hostnames (*.qlab.local) img [back to top]

Setup NFS permission mapping

There are more options for NFS. The last 3 columns, Squash option, Anonymous GID and Anonymous UID are used for configuring the permission mapping.

img

In Squash option, there are 3 options and their definitions are described as below:

SQUASH_ROOT_USER: Only map root(uid/gid 0) to anonymous uid/gid or specific group/user

SQUASH_NO_USERS: Not map to any user to keep the same uid/gid

SQUASH_ALL_USERS: Map all users to anonymous uid/gid or specific group/user


Here are examples to show you how these options work.

  • Example 1: (SQUASH_ROOT_USER)

    • Choose and configure this option and mount the shared folder from the client.
    • Then write the file from the root and the other user, tsd.

You can see only the owner of the file written by root is mapped to nobody:nogroup (65534:65534). The owner of the file written by tsd is still maintained, no changes.

img

  • Example 2: (SQUASH_NO_USERS)

    • Choose and configure this option and mount the shared folder from the client.
    • Then write the file from the root and the other user, tsd.

You can see the files owners are the same as the ones who write into this shared folder.

img

Attention: While SQUASH_NO_USER option is configured, the remote root users own the root permission to change any files in the shared folder. For security, you need to pay more attention while using it.

  • Example 3: (SQUASH_ALL_USERS)

    • Choose and configure this option and mount the shared folder from the client.
    • Then write the file from the root and the other user, tsd.

You can see the files owners written by both root and tsd are mapped to nobody:nogroup (65534:65534).

img

Note: There were 4 squash options in the older QTS firmware(less than QTS v4.4.1). Now, there are 3 squash options. You can refer to the table below for the information of changes.

img

[back to top]

Related Articles:

  1. Failed to get the file attribute using nfs4_getfacl command from the client?
  1. Failed to mount the shared folder of NAS using NFS v4 because of No such file or directory?
  1. Failed to mount the shared folder of NAS using NFS v4 because of protocol not supported?
  1. What’s the option of sync wdelay/no wdelay, and secure in NFS host access settings?

这篇文章有帮助吗?

谢谢您,我们已经收到您的意见。

请告诉我们如何改进这篇文章:

如果您想提供其他意见,请于下方输入。

选择规格

      显示更多 隐藏更多
      open menu
      back to top