Can't modify smbpasswd

Kernels & Hardware, configuring network, installing services

Can't modify smbpasswd

Postby WarKirby » 2010-08-27 15:37

Hello folks.
Smbpasswd has mysteriously stopped working. I think I know why. It's happened while I was testing a script to delete users, which runs "userdel -r $username" and then "smbpasswd -x $username"

Attempting to use smbpasswd fails, like so:

Code: Select all
roshniserver:/home/ali# smbpasswd -a naveed
New SMB password:
Retype new SMB password:
Unable to modify TDB passwd: NT_STATUS_UNSUCCESSFUL!
Failed to add entry for user naveed.
Failed to modify password entry for user naveed


the user definitely already exists and has a password set in unix.
I am logged in as root while doing it.
I've tried restarting samba several times.

This seems to be a similar problem: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=529735

but no solution is provided. Any ideas ?

Edit: I also found this which seems very similar too, and again nobody helped him :(
http://www.linuxquestions.org/questions ... dc-666884/
WarKirby
 
Posts: 191
Joined: 2010-08-03 12:06

Re: Can't modify smbpasswd

Postby smallchange » 2010-08-27 17:40

It looks like the user already exists and has a password in samba also.
smallchange
 
Posts: 1740
Joined: 2009-05-04 15:56

Re: Can't modify smbpasswd

Postby WarKirby » 2010-08-28 12:27

the user does not already exist in samba, i've never used this username until yesterday, as a test.
i get a similar error trying to remove any user
WarKirby
 
Posts: 191
Joined: 2010-08-03 12:06

Re: Can't modify smbpasswd

Postby smallchange » 2010-08-28 13:59

It might be permissions on passdb.tdb in /var/lib/samba/. In my case it is
-rw------- 1 root root 36K Aug 19 11:23 passdb.tdb
smallchange
 
Posts: 1740
Joined: 2009-05-04 15:56

Re: Can't modify smbpasswd

Postby WarKirby » 2010-08-30 09:57

The permissions of mine are identical to yours.

I think this issue may be a corruption of the passdb.tdb (thank you for telling me where it is!) due to using unix password sync while deleting users from unix and samba

I've resolved it by deleting passdb and recreating the lost accounts.
WarKirby
 
Posts: 191
Joined: 2010-08-03 12:06

Re: Can't modify smbpasswd

Postby peterRB » 2011-05-11 10:50

Just to confirm: I just had a similar but even more innocent problem, and solved it by deleting /var/lib/samba/passdb.tdb.

My problem was simply that I could not create the very first user/password using smbpasswd, in a new kubuntu 10.04 installation. Doing sudo smbpasswd -a smbguest failed with the same message:

Unable to modify TDB passwd: NT_STATUS_UNSUCCESSFUL!

User smbguest did properly exist in /etc/passwd, but smbpasswd -a would not work.

At WarKirby's suggestion, I deleted passdb.tdb. Result: sudo smbpasswd -a smbguest then worked fine, and passdb.tdb was recreated at full size in /usr/lib/samba.

Looks like something about that tdb file is corrupt upon installation (of kubuntu 10.04).
peterRB
 
Posts: 1
Joined: 2011-05-10 21:13

Re: Can't modify smbpasswd

Postby aldasegu » 2014-04-01 06:57

I had the same problem. I could add new user with:
Code: Select all
pdbedit -a -u username
aldasegu
 
Posts: 1
Joined: 2014-04-01 06:53


Return to System configuration

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable