跳转到主内容

当CIFS客户端访问UNIX安全模式资源时、名称映射的工作原理是什么?

Views:
20
Visibility:
Public
Votes:
0
Category:
not set
Specialty:
not set
Last Updated:

适用场景

  • ONTAP 9
  • UNIX
  • CIFS

问题解答

  • 由于用户已在 域中进行身份验证、因此ONTAP需要为每个新创建的CIFS会话构建用户凭据。
  • 要构建凭据、 ONTAP需要将Windows用户映射到UNIX用户、以便能够 通过ns-switch中定义的源查找映射的UID和GID

::> vserver services name-service ns-switch show
                         Source
        Vserver      Database       Order
        --------------- ------------     ---------
        vs0        hosts         files,
                          dns
        vs1        passwd        files,
                          ldap, nis
        2 entries were displayed.

  • ONTAP将尝试按以下顺序将Windows用户映射到UNIX用户、以尝试通过ns-switch中定义的源查找UNIX用户的UID和GID:
  1. 显式名称映射: ONTAP 会根据  定义的显式名称映射"win-UNIX)规则、通过字符串比较尝试匹配Windows用户

::> vserver name-mapping show -vserver SVM01 -direction win-unix

示例:

Vserver:  SVM01
Direction: win-unix
Position Hostname      IP Address/Mask
-------- ---------------- ----------------
1     test.com      -          Pattern: EXAMPLE\\administrator
                     Replacement: nobody
2     -         10.238.2.34/32    Pattern: EXAMPLE\\(.+)
                     Replacement: \_1

注意: 如何创建和了解Vserver名称映射规则 

  1. 隐式名称映射: 如果没有匹配的显式规则、ONTAP会 尝试将Windows用户映射到具有相同用户名的UNIX用户

示例: Windows用户"main\user01"到UNIX用户"user01"

  1. 默认UNIX用户: 如果上述两种方法都失败(例如、文件管理器无法提取映射的UNIX用户的UID和GID)、出于任何原因、文件管理器会将Windows用户映射到CIFS服务器选项中定义的"默认UNIX用户"。

::> vserver cifs options show -vserver SVM01 -fields default-unix-user

注意: 默认 情况下、默认UNIX用户设置为"pcuser"(UID 6554)。

  • 由于卷设置为UNIX安全模式、因此会根据UNIX凭据的UID和GID授予或拒绝访问权限。
  • 确认 名称映射:

示例:

::> set -privilege advanced
::*> vserver services access-check name-mapping show -node cluster1-node01 -vserver SVM01 -direction win-unix -name EXAMPLE\Administrator 

EXAMPLE\Administrator maps to root

 

 

 

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.