我如何让FreeNAS使用LDAPauthentication?

我正在尝试使用LDAP身份validation设置具有CIFS共享的FreeNAS 9.1.1服务器。

我build立了一个OpenLDAP服务器,使用smbldap-populate填充它,为我自己添加一个用户帐户,并configurationFreeNAS上的LDAP客户端来使用这个目录。 在我看来,像FreeNAS可以很好地检索用户和组,因为getent passwdgetent group输出列出了我在OpenLDAP服务器上设置的实体。

到现在为止还挺好。 我现在创build了一个新的ZFS卷,并将其设置为由我的LDAP用户帐户和Domain Admins组拥有。

当我现在尝试使用共享时,通过在Windows命令行上发出net use \\freenas\zfs0-share ,得到以下结果:

 System error 59 has occured. An unexpected network error occurred. 

在我的FreeNAS控制台中,我得到以下输出:

 freenas smbd: auth/check_samsec.c:491(check_sam_security) check_sam_security: make_server_info_sam() failed with NT_STATUS_UNSUCCESSFUL 

这个错误是什么意思,我该如何解决?

为了find这个问题的原因,我首先在交互模式下以更高的debugging级别启动Samba,以查看输出中可能有帮助的任何消息:

 /usr/local/sbin/smbd --interactive --debuglevel=3 

现在我得到了比以前更有帮助的输出:

 check_ntlm_password: Checking password for unmapped user [WORKGROUP]\[osalzburg]@[LDAP] with the new password interface check_ntlm_password: mapped user is: [FREENAS]\[osalzburg]@[LDAP] init_sam_from_ldap: Entry found for user: osalzburg Primary group S-1-5-21-1400563477-347728745-2499486669-512 for user osalzburg is a UNKNOWN and not a domain group Forcing Primary Group to 'Domain Users' for osalzburg The primary group domain sid(S-1-5-21-1134279832-878937066-538846017-513) does not match the domain sid(S-1-5-21-1400563477-347728745-2499486669) for osalzburg(S-1-5-21-1400563477-347728745-2499486669-3002) check_sam_security: make_server_info_sam() failed with 'NT_STATUS_UNSUCCESSFUL' check_ntlm_password: Authentication for user [osalzburg] -> [osalzburg] FAILED with error NT_STATUS_UNSUCCESSFUL error packet at smbd/sesssetup.c(124) cmd=115 (SMBsesssetupX) NT_STATUS_UNSUCCESSFUL Server exit (failed to receive smb request) Terminated: 15 

这里的关键是部分:

 The primary group domain sid (S-1-5-21-1134279832-878937066-538846017-513) does not match the domain sid (S-1-5-21-1400563477-347728745-2499486669) for osalzburg(S-1-5-21-1400563477-347728745-2499486669-3002) 

为了解决这个不匹配问题,我将FREENAS sambaDomainName条目的FREENAS sambaDomainNameS-1-5-21-1400563477-347728745-2499486669正如本bug报告中的build议。

我不知道到底在哪里弄乱了我的设置,但运行带有debugging输出的Samba是找出问题原因的关键。