Linux – samba4: session setup failed: NT_STATUS_UNSUCCESSFUL

linuxsamba4Ubuntu

I am having trouble with my samba4 installation. For a long time it has been working without issue. I use webmin to configure users and although the module is only supposed to support samba3 it works no problem.

Recently I was unable to connect from my windows workstations to the shares I had configured. I studied the logs and documentation. I raised the logging level to debug and am getting some interesting entries.

[2016/04/24 12:01:08.574053,  2] ../source3/param/loadparm.c:2686(lp_do_section)
  Processing section "[bigstorage]"
[2016/04/24 12:01:08.574194,  2] ../source3/param/loadparm.c:2686(lp_do_section)
  Processing section "[homes]"
[2016/04/24 12:01:08.584319,  2] ../source3/auth/auth.c:305(auth_check_ntlm_password)
  check_ntlm_password:  authentication for user [tiny] -> [tiny] -> [tiny] succeeded
[2016/04/24 12:01:08.585051,  1] ../source3/auth/token_util.c:430(add_local_groups)
  SID S-1-5-21-998636918-4013062214-3753039175-1105 -> getpwuid(3000012) failed

I stopped the smbd service and ran in interactive mode on the command line as root:

smbd -S -d=3 -i

When I try to list shares from my laptop (mint 17.3) I get the following:

chris@minty-laptop ~ $ smbclient -L=thinky
WARNING: The "syslog" option is deprecated
Enter chris's password: 
session setup failed: NT_STATUS_UNSUCCESSFUL

This is the stdout from the smbd command:

github gist

This is the /etc/samba/smb.conf file:

github gist

The same happens when I attempt to open mapped network drives on my windows machines that have worked for a long time without issue.

Google didn't turn up much related to this issue, although it looks similar to many others. Unless I'm confused… any guidance or advice appreciated.

Cheers

Chris

Best Answer

Old AF but at least I can post as a guest. I ran into this issue today with one user, created a second user and started troubleshooting.

Error:

[dev@centos8 share]$ smbclient -U user1 //localhost/User1
Unable to initialize messaging context
Enter WORKGROUP\user1's password:
session setup failed: NT_STATUS_UNSUCCESSFUL

User2 was working fine, not sure why. Found out that by default SAMBA used tdbsam as the credential store, which is actually just a local file located at /usr/local/samba/private/passdb.tdb.

You can use the command pdbedit -Lv to view a list of all the SAMBA users.

My issue was very clear right off the bat, the only difference between user1 and user2 had been that user1 somehow had a (NULL SID) value for the primary group SID:

Primary Group SID: (NULL SID).

Since the group was missing, it was a pretty obvious red flag that permissions will be messed up throughout.

Related Topic