使用 Kerberos 和 Linux KDC 的 Windows 7 NFS 客户端

Mik*_*ike 8 windows-7 nfs kerberos scientific-linux freeipa

我正在尝试将 Windows 7 Enterprise 客户端配置为使用 Kerberos 和 Linux KDC 在 Linux NFS 服务器上挂载 NFSv4 共享。

设置是:

  • IPA 服务器(操作系统:Scientific Linux 6.4,包:ipa-server)
  • NFS 服务器(操作系统:Scientific Linux 6.4,包:nfs-utils)
  • Windows 7 客户端(操作系统:64 位企业版,功能:NFS 客户端)

脚步:

  1. 在 IPA 服务器上,使用密码为 Windows 客户端创建一个主体:

    ipa host-add --ip-address=10.10.0.100 win7ent-client.contoso.com
    ipa-getkeytab -s ipa.contoso.com -p host/win7ent-client.contoso.com -k win7ent-client.keytab -P
    ^
    | 
    This will create a principal and register the client with IPA server
    Set a random password - e.g. - jU96e3Urp6
    
    Run Code Online (Sandbox Code Playgroud)

    为客户端添加 NFS 服务:

    ipa service-add nfs/win7ent-client.contoso.com

  2. 在 Windows 客户端上:

    ksetup /setdomain CONTOSO.COM
    ksetup /setmachpassword <password set on step 1>
    ksetup /addrealmflags CONTOSO.COM sendaddress delegate
    ksetup /mapuser * *
    
    Run Code Online (Sandbox Code Playgroud)

    重新启动 Windows 客户端

    跑:

    ksetup.exe /DumpState

    这显示了当前配置:

    default realm = CONTOSO.COM (external)
    CONTOSO.COM:
        (no kdc entries for this realm)
        Realm Flags = 0x5 SendAddress Delegate
    Mapping all users (*) to a local account by the same name (*).
    
    Run Code Online (Sandbox Code Playgroud)

    在 Windows 客户端上创建本地用户,不需要密码,名称在 IPA 服务器上已存在。否则,您将收到错误 - 1332:未完成帐户名和安全 ID 之间的映射

    测试您是否可以作为用户获得票证:

    runas /user:joe@CONTOSO.COM cmd

    在新的命令窗口中,运行:

    列表

    这将输出当前的票证信息:

    当前登录 ID 为 0:0x6c70e

    Cached Tickets: (1)
    
    #0> Client: joe @ CONTOSO.COM
        Server: krbtgt/CONTOSO.COM @ CONTOSO.COM
        KerbTicket Encryption Type: AES-256-CTS-HMAC-SHA1-96
        Ticket Flags 0x40e10000 -> forwardable renewable initial pre_authent name_canonicalize
        Start Time: 2/22/2014 5:22:07 (local)
        End Time:   2/23/2014 5:22:07 (local)
        Renew Time: 3/1/2014 5:22:07 (local)
        Session Key Type: AES-256-CTS-HMAC-SHA1-96
    
    Run Code Online (Sandbox Code Playgroud)
  3. NFS 服务器配置

    mkdir -p /winshare/joe
    chown -R joe:joe/winshare/joe
    exportfs -o rw,sec=krb5 *:/winshare/joe
    
    Run Code Online (Sandbox Code Playgroud)

尝试在 Windows 客户端上挂载上述共享时:

mount -o sec=krb5 nfs.contoso.com:/winshare/joe E:

我收到以下错误:

网络错误 - 121

Type 'NET HELPMSG 121' for more information.

C:\Windows\system32>NET HELPMSG 121

The semaphore timeout period has expired.
Run Code Online (Sandbox Code Playgroud)

尝试使用ms-nfs41-client-x64也失败:

C:\Users\joe\Desktop\ms-nfs41-client-x64>nfs_mount.exe -o sec=krb5 * nfs.contoso.com:/winshare/joe

WNetUseConnection(*:, \\nfs.contoso.com\winshare\joe) failed with error code 1231.
The network location cannot be reached. For information about network troubleshooting, see Windows Help.
Run Code Online (Sandbox Code Playgroud)
  1. 使用 sec=sys 的 NFS 共享有效
  2. 在 joe 工作时登录到 Windows-7 客户端。
  3. 在 Windows 日志记录工作后将 Putty 粘贴到 NFS 服务器(只要您先安装适用于 Windows 的 MIT Kerberos 客户端)。

使用 Kerberos 时,唯一不起作用的是 NFS。

Tom*_*mek 1

据我所知,这一步可能不需要:

为客户端添加NFS服务:

ipa service-add nfs/win7ent-client.contoso.com
Run Code Online (Sandbox Code Playgroud)

您需要服务器的 nfs 服务。

如果您确定 Windows 客户端需要 nfs 服务,那么它很可能应该使用与该客户端的主机主体完全相同的密码。

另外:您是否在服务器上启用了安全 nfs?我不记得很久以前搬到 CentOS 7 时的具体情况(systemctl (enable|start) nfs-secure 是你的朋友),但我认为你应该在 /etc/sysconfig/nfs.conf 中查找它。