Samba: winbind database getting out of whack

Was having some trouble with a few users not able to access their home directories on a Samba server.

/var/log/samba/log.smbd showed:

[2008/07/29 09:36:52, 2] auth/auth.c:check_ntlm_password(319)  check_ntlm_password:  Authentication for user [username] -> [username] FAILED with error NT_STATUS_NO_SUCH_USER
[2008/07/29 09:36:52, 0] smbd/service.c:make_connection(1191)  hostname (10.10.10.10) couldn’t find service username

Testing:

  • Their Active Directory account was good.
  • On file server, kinit username worked.
  • On file server, wbinfo -u returned that user.
  • On file server, net user returned that user.
  • On file server, wbinfo -i username returned “Could not get info for user username“.

The problem ended up being a corrupted /var/cache/samba/winbindd_idmap.tdb.  Moved the file, restarted samba, and after a couple of minutes, everyone was back.  The only problem was that that file contained the map of username to UID.  When it recreated, nothing matched up.  So I had to change ownership of everyone’s stuff.  Easy enough to do with perl:

my @dirs = <*>;
for my $dir (@dirs) {
    next if $dir =~ /_/;
    system("chown -R \"$dir\:Domain Users\" $dir");
}

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-spam image