Solved Can't Login To Shares After Upgrading To Samba 4

As part of a long needed update to my FreeBSD servers, I also upgraded Samba 3 to Samba 4. Since the upgrade my previous login no longer works. In searching the web, it seems the old smbpasswd has been replaced with samba-tool? OK, so I attempt to recreate my user with that tool:

Code:
 # samba-tool user create drew
New Password:
Retype Password:
Unable to open tdb '/var/db/samba4/private/sam.ldb': Input/output error
Failed to connect to 'tdb:///var/db/samba4/private/sam.ldb' with backend 'tdb': Unable to open tdb '/var/db/samba4/private/sam.ldb': Input/output error
ERROR(ldb): Failed to add user 'drew':  - Unable to open tdb '/var/db/samba4/private/sam.ldb': Input/output error
Originally, this file did not exist. However, I created it and set the mode like the other files:

Code:
   root@vm pts/0 03:13:04 Fri Nov 20 /var/db/samba4/private/
 # ll
total 1049
drwx------  3 root  wheel       6 Nov 20 02:51 .
drwxr-xr-x  6 root  wheel      27 Nov 20 03:16 ..
drwx------  2 root  wheel      12 Nov 20 03:15 msg.sock
-rw-------  1 root  wheel  421888 Nov  5 21:10 passdb.tdb
-rw-------  1 root  wheel       0 Nov 20 02:51 sam.ldb
-rw-------  1 root  wheel  430080 Nov  5 21:10 secrets.tdb
Can anyone please nudge me toward what I'm missing?

Thanks,

Drew
 
smbpasswd is still a thing and works fine (with the correct backend). Samba 4 did however at some point change their database type so that's probably what you're running into.
https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html --> passdb backend (G)
From what I can remember pdbedit works just fine
pdbedit -a -u TheUserIWantToCreate
Thank you for your assistance. I don't recall what issue I had with pdbedit but I was able to use smbpasswd to create my user. This solved my issue.

Cheers,

Drew
 
smbpasswd is still a thing and works fine (with the correct backend). Samba 4 did however at some point change their database type so that's probably what you're running into.
https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html --> passdb backend (G)
From what I can remember pdbedit works just fine
pdbedit -a -u TheUserIWantToCreate
Hey!! Greetings

I am still facing issue with creating user.

I've tried pdbedit and smbpasswd too, still I an unable to create user. Please let me know, what's missing.

Thanks, Subash
 

Attachments

  • Screenshot_2023-11-21_22-56-51.png
    Screenshot_2023-11-21_22-56-51.png
    24.4 KB · Views: 82
Back
Top