sam.ldb
我在 Ubuntu Server 20.04 上运行 Samba 版本 4.11.6-Ubuntu。我需要修改 Samba 用户帐户,但由于它显然不存在,我无法打开。以下是输出:
$ 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,
我list
也无法使用。我还没有尝试过任何其他子命令。
我检查了它所指的文件夹。内容如下:
$ ls
msg.sock netlogon_creds_cli.tdb passdb.tdb secrets.ldb secrets.tdb
Samba 服务器仅作为文件服务器运行。我没有运行 LDAP(据我所知)。我最初在 Ubuntu Server 18.04 下安装了 Samba。除了向 .conf 文件添加共享之外,我从未对安装进行过任何修改。