I have a debian server with samba. I can no longer manage users accounts. I can't add, modify or remove them.

This is Debian wheezy with samba 3.6.6. There is no ldap and the database backend is tdb. I usually managed users with smbpasswd, but it no longer works.

When I try to create a new user:

smbpasswd -a blabla
New SMB password: ****
Retype new SMB password: ****
Failed to add entry for user blabla.

Trying to remove users with pdbedit or smbpasswd isn't working also, returning the same error:

# pdbedit -L olduser

# smbpasswd -x olduser
Failed to delete entry for user olduser.

I tried using tdbtool

# tdbtool /var/lib/samba/passdb.tdb check
Database integrity is OK and has 570 records.

I checked the keys length, I made a tiny perl script that checked all the output of tdbtool keys to see if one entry had different keys thant it should, but I see no mistakes there:

key 9 bytes: USER_old

I'm stuck, any hint would be appreciated, thank you.


Finally I got an answer in the samba mailing list:


This happens if samba runs in PDC mode and the user is not in /etc/passwd.

I saw the user I was trying to delete was not in passwd, so I added it, then I removed it again with smbpasswd -x and I also removed it from passwd.

Problem solved.


In this case I use

pdbedit -x user_name
  • 1
    Can you give some information on how that is different from what the OP tried? What does this command do and why does it work? – jornane Jul 24 '15 at 6:47

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.