部署网络文件系统

网络文件系统 (NFS) 提供一个文件共享解决方案,可用于通过 NFS 协议在运行 Windows Server 和 UNIX 操作系统的计算机之间传输文件。 本文介绍安装 NFS 并创建第一个 NFS 共享时应遵循的步骤。

NFS authentication

NFS Server for Windows Server 支持多种身份验证方法,包括 Kerberos 和 AUTH_SYS。 选择的身份验证方法取决于组织的安全要求和所使用的 NFS 版本。 在创建 NFS 文件共享之前,请考虑哪种身份验证方法最适合你的环境。

对于 NFS 版本 4.1 和 NFS 版本 3.0 协议,建议使用 Kerberos (RPCSEC_GSS)。 下面三个选项可提高安全保护级别:

  • Krb5: Uses the Kerberos version 5 protocol to authenticate users before granting them access to the file share.

  • Krb5i: Uses the Kerberos version 5 protocol to authenticate with integrity checking (checksums), which verifies that the data isn't altered.

  • Krb5p: Uses the Kerberos version 5 protocol, which authenticates NFS traffic with encryption for privacy. 此选项是最安全的 Kerberos 选项。

    Note

    也可选择不使用上述 Kerberos 身份验证方法,而通过 AUTH_SYS 启用未映射用户访问。 We strongly discourage using this option as it removes all authentication protections and allows any user with access to the NFS server to access data. 使用非映射用户访问时,可以指定允许通过 UID 或 GID 进行未映射用户访问(这是默认设置)。 还可允许匿名访问。

Prerequisites

若要部署 NFS,请确保满足以下先决条件:

  • 运行 Windows Server 的一台或多台计算机,在其中安装 NFS 组件的两个主要服务:适用于 NFS 的服务器和用于 NFS 的客户端。 可将这些组件安装在同一计算机上,也可安装在不同计算机上。

  • 如果对 NFS 服务器或客户端使用基于 UNIX 的计算机,则必须与以下 NFS 协议规范之一兼容:

    • NFS Version 4.1 Protocol Specification, as defined in RFC5661

    • NFS Version 3 Protocol Specification, as defined in RFC1813

    • NFS Version 2 Protocol Specification, as defined in RFC1094

安装网络文件系统

若要将网络文件系统角色安装为独立服务器,请执行以下步骤:

下面介绍如何使用 Windows 桌面中的服务器管理器安装 DNS 服务器角色。

  1. From the Windows desktop, open the Start menu, then select the Server Manager tile.

  2. On the menu, go to Manage, and then select Add Roles and Features.

  3. “开始之前 ”页上,选择 “下一步 ”开始。

  4. “选择安装类型 ”页上,选择 “基于角色”或“基于功能”的安装 选项,然后选择“ 下一步”。

  5. “选择目标服务器 ”页上,保留默认选项。 Select Next.

  6. “选择服务器角色”页上,展开“文件和存储服务文件和 iSCSI 服务>”,选中“文件服务器”、“文件服务器资源管理器”和“服务器”以获取 NFS,然后选择“下一步”。

    1. You're prompted to add features that are required for Server for NFS, if you're happy with the defaults, select Add Features.
  7. On the Select features page, you can leave the default selections, and then select on the Next button.

  8. On the DNS Server page, review the role description and things to note, select Next to continue.

  9. “确认安装选择 ”页上,查看所选角色和功能,然后在“ 安装 ”按钮上选择以开始安装过程。

  10. Once the installation is complete, select Close. 安装后无需重启。

创建 NFS 文件共享

若要创建 NFS 文件共享,请执行以下步骤。

Tip

NFS 版本 4.1 允许创建或复制包含非法字符的文件名。 如果尝试使用 vi 编辑器打开文件,则会显示文件已损坏。 无法从 vi 保存文件、重命名、移动文件或更改权限。 避免使用非法字符。

下面介绍如何使用 Windows 桌面中的服务器管理器创建 NFS 文件共享。

  1. 以本地管理员组成员的身份登录服务器。

  2. 服务器管理器自动启动。

    • If the tool doesn't automatically start, select Start. Enter servermanager.exe, and then select Server Manager.
  3. 在左侧,选择“文件和存储服务”,然后选择“共享”。

  4. Under the Shares column, in the Tasks drop down menu, select New Share.

  5. On the Select Profile page, select either NFS Share - Quick or NFS Share - Advanced, then select Next.

  6. On the Share Location page, select a server and a volume, then select Next.

  7. On the Share Name page, enter a name for the new share. Confirm the share path and remote path, then select Next.

  8. On the Authentication page, specify the authentication method you want to use, then select Next. Share authentication methods are discussed in the NFS authentication section.

  9. On the Share Permissions page, select Add. The Add Permissions dialog opens.

    1. Choose the level of user permissions to grant: Host, Netgroup, Client group, or All Machines.

    2. Use the drop-down menu to select the preferred Language encoding.

    3. Use the drop-down menu to select the preferred Share permissions.

    4. Select Add, then select Next.

  10. On the Permissions page, configure access control for your selected users. When you're ready, select Next.

  11. On the Confirmation page, review your configuration, and select Create to create the NFS file share.