Francesc Guasch Ortiz
2015-Mar-03 12:22 UTC
[Samba] Failed to modify entry for user in samba with tdb backend
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 olduser:1314:OldName # 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.
Linda W
2015-Mar-03 18:33 UTC
[Samba] Failed to modify entry for user in samba with tdb backend
Francesc Guasch Ortiz wrote:> > 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.Very basic thought here, and sorry if you already checked this, but There are parameters for <samba cfg dir(usually /etc/samba?)/smb.conf that specify how to do those things. have you tried running those command manually to see if they work?> man smb.conf |egrep 'script.*\([GS]\)'abort shutdown script (G) add group script (G) add machine script (G) add user script (G) add user to group script (G) check password script (G) delete group script (G) delete user from group script (G) delete user script (G) logon script (G) magic script (S) rename user script (G) set primary group script (G) shutdown script (G) username map script (G) Many (*some*) have builtin defaults. So if you don't have them in your smb.conf file, you might check to see if the defauts work. (as root:) testparm -sv|grep script (if you don't do it as root it prints nothing which is a bit weird as I can see the parms using 'more'(or less) on the file directly.
Klaus Hartnegg
2015-Mar-03 19:41 UTC
[Samba] Failed to modify entry for user in samba with tdb backend
Am 03.03.2015 um 13:22 schrieb Francesc Guasch Ortiz:> # smbpasswd -x olduser > Failed to delete entry for user olduser.This happens if samba runs in PDC mode and the user is not in /etc/passwd.
Francesc Guasch
2015-Mar-04 08:24 UTC
[Samba] Failed to modify entry for user in samba with tdb backend
El 03/03/15 a les 20:41, Klaus Hartnegg ha escrit:> Am 03.03.2015 um 13:22 schrieb Francesc Guasch Ortiz: >> # smbpasswd -x olduser >> Failed to delete entry for user olduser. > > This happens if samba runs in PDC mode and the user is not in /etc/passwd. >Thank you Klaus, that's it ! As you said, 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 removed it also from passwd. Thank you very much