Red Squirrel

No Lifer
May 24, 2003
70,321
13,664
126
www.anyf.ca
When using the smbpasswd command, where does it store the password info?

I found a file called smbpasswd in the samba folder, but it's not that, since it only has the user nobody and administrator, but yet I have way more accounts.

Also, what does this mean?

Failed to initialise SAM_ACCOUNT for user vmwin2k2. Does this user exist in the UNIX password database ?
Failed to modify password entry for user vmwin2k2

Whenever I try to do something to that machine account, such as deleting it, I get that error.

Oh, and I even tried deleting it from the passwd database, no change of error.
 

xcript

Diamond Member
Apr 3, 2003
8,258
2
81
# cat /etc/samba/smb.conf |grep /smbpasswd
smb passwd file = /etc/samba/private/smbpasswd
 

Red Squirrel

No Lifer
May 24, 2003
70,321
13,664
126
www.anyf.ca
I don't have that line anywhere... could it be it's using a different type of database or something? Or just using the unix one, but with a different group?
 

xcript

Diamond Member
Apr 3, 2003
8,258
2
81
It might be in /var/lib/samba/private

# locate smbpasswd ;)

And as for the SAM_ACCOUNT error, I've only ever seen that when trying to modify an account that doesn't also exist in /etc/passwd. Try re-adding the account to the system then smbpasswd -x user or whatever.
 

Red Squirrel

No Lifer
May 24, 2003
70,321
13,664
126
www.anyf.ca
I think I found the culpit:

passdb backend = tdbsam guest

That line should be

passdb backend = smbpasswd

Is that right? Then I add the line to tell it where to store the smbpasswd database.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
If you run testparm with the -v option it'll print out all of the options Samba is using, even those not in smb.conf
 

Red Squirrel

No Lifer
May 24, 2003
70,321
13,664
126
www.anyf.ca
k so I tried that, but now I can't access the server at all, it asks for a password when I type \\borg but guests should be able to at least get to the root of it... then depending on what the shares say, such as valid users = it should let them in. I readded the accounts with smbpasswd.

Edit: hmm smbpasswd command seems to still be reading the old database, the one I have no clue where is stored. Maybe it's designed only for the backend that was set.
 

xcript

Diamond Member
Apr 3, 2003
8,258
2
81
Yeah, switching from tdb->smbpasswd the passwd, etc. files are different.

IIRC, the *.tdbs are usually stored in /var/cache/samba.

Perhaps you should switch back to tdbsam (or you'll have to recreate all the accounts). ;)

Edit: Sorry, I initially assumed you were using smbpasswd as it's the default. :)
 

Red Squirrel

No Lifer
May 24, 2003
70,321
13,664
126
www.anyf.ca
Yeah decided to keep the old settings, the other way broke too many things. \\borg\ invalid network path, etc...

I'll just have to try and find that DB and manually delete the accounts it won't let me delete.