M HYPE SPLASH
// news

Samba 4 Database File sam.ldb Missing?

By Emma Terry

I am on Ubuntu Server 20.04, running Samba version 4.11.6-Ubuntu. I need to modify a Samba user account, but I am unable to open sam.ldb due to it apparently not being present. Here is the output:

$ samba-tool user edit username
ltdb: tdb(/var/lib/samba/private/sam.ldb): tdb_open_ex: could not open file /var/lib/samba/private/sam.ldb: No such file or directory
Unable to open tdb '/var/lib/samba/private/sam.ldb': No such file or directory
Failed to connect to 'tdb:///var/lib/samba/private/sam.ldb' with backend 'tdb': Unable to open tdb '/var/lib/samba/private/sam.ldb': No such file or directory
ERROR(ldb): uncaught exception - Unable to open tdb '/var/lib/samba/private/sam.ldb': No such file or directory File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 186, in _run return self.run(*args, **kwargs) File "/usr/lib/python3/dist-packages/samba/netcmd/user.py", line 2435, in run samdb = SamDB(url=H, session_info=system_session(), File "/usr/lib/python3/dist-packages/samba/samdb.py", line 65, in __init__ super(SamDB, self).__init__(url=url, lp=lp, modules_dir=modules_dir, File "/usr/lib/python3/dist-packages/samba/__init__.py", line 115, in __init__ self.connect(url, flags, options) File "/usr/lib/python3/dist-packages/samba/samdb.py", line 81, in connect super(SamDB, self).connect(url=url, flags=flags,

I cannot list users either. I haven't tried any other subcommands yet.

I checked the folder it's referring to. Here are the contents:

$ ls
msg.sock netlogon_creds_cli.tdb passdb.tdb secrets.ldb secrets.tdb

The Samba server is running only as a File Server. I'm not running an LDAP (as far as I know). I installed Samba originally under Ubuntu Server 18.04. Other than adding shares to the .conf file I've never made any modifications to the installation.

3 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy