3

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.

Kraus
  • 61
  • 1
  • 1
  • 3
  • I am going to make a big guess here, you are running Samba as a standalone server and you are trying to use the tools meant for a Samba AD DC. can you post your smb.conf file (please remove any lines that start with '#' or ';') – Rowland Penny Aug 30 '20 at 10:18
  • My Samba install is configured as a File Server. No AD is needed since there is no Windows network. Samba defines samba-tool as its "Main Samba administration tool." Would that not mean it should function regardless? If it is only for AD DC setups, should there not be a message informing the user? – Kraus Aug 31 '20 at 17:17
  • 4
    Good point, the man page should say something like 'Main Samba AD administration tool'. You need to use the old smbpasswd & pdbedit tools with a Samba standalone server, 'samba-tool' is only for AD domain computers, users & groups etc. – Rowland Penny Aug 31 '20 at 19:52

0 Answers0