I'm trying to set up a FreeNAS 9.1.1 server with CIFS shares with LDAP authentication.

I've set up an OpenLDAP server, populated it with smbldap-populate, added a user account for myself and configured the LDAP client on the FreeNAS to utilize the directory. It seems to me like FreeNAS can retrieve the users and groups fine, as the getent passwd and getent group output lists the entities that I've set up on my OpenLDAP server.

So far so good. I've now created a new ZFS volume and set it up to be owned by my LDAP user account and the Domain Admins group.

When I now try to use the share, by issuing net use \\freenas\zfs0-share on my Windows command line, I get the following result:

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

In my FreeNAS console, I get the following output:

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

What does this error indicate and how can I resolve it?


To find the cause of this issue, I first started Samba in interactive mode with a higher debug level to see any messages in the output that could help:

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

Now I got more helpful output than before:

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 key here is the part:

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)

To resolve the mismatch, I changed the sambaSID of my FREENAS sambaDomainName entry to S-1-5-21-1400563477-347728745-2499486669 as suggested in this bug report comment.

I'm not sure where exactly I messed up my setup, but running Samba with debug output was key to finding the cause of the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.