如何讓 FreeNAS 與 LDAP 驗證一起使用?

如何讓 FreeNAS 與 LDAP 驗證一起使用?

我正在嘗試設定具有 CIFS 共用和 LDAP 驗證的 FreeNAS 9.1.1 伺服器。

我已經設定了一個 OpenLDAP 伺服器,用 填充它smbldap-populate,為自己添加了一個使用者帳戶,並在 FreeNAS 上配置了 LDAP 用戶端以利用該目錄。在我看來,FreeNAS 可以很好地檢索使用者和群組,因為getent passwdgetent group輸出列出了我在 OpenLDAP 伺服器上設定的實體。

到目前為止,一切都很好。我現在創建了一個新的 ZFS 卷,並將其設定為由我的 LDAP 使用者帳戶和網域管理員團體。

當我現在嘗試使用共用時,透過net use \\freenas\zfs0-share在 Windows 命令列上發出命令,我得到以下結果:

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

此錯誤表明什麼以及如何解決它?

答案1

為了找到此問題的原因,我首先在交互模式下以更高的調試級別啟動 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)

為了解決不匹配問題,我將條目更改sambaSIDFREENAS sambaDomainNameS-1-5-21-1400563477-347728745-2499486669建議的這個錯誤回報評論

我不確定我到底在哪裡弄亂了設置,但是使用調試輸出運行 Samba 是找到問題原因的關鍵。

相關內容