[Samba] Unable to use samba-tool
Rowland Penny
rowlandpenny241155 at gmail.com
Tue Nov 10 14:01:10 UTC 2015
On 10/11/15 13:49, mathias dufresne wrote:
> First don't forget to reply to Rowland, he's question has sense.
>
> samba-tool user list
> ltdb: tdb(/var/lib/samba/private/sam.ldb): tdb_open_ex: could not open
> file /var/lib/samba/private/sam.ldb: *Permission denied*
> --> You should have run that command with a non-root user. A root user
> would not face such issue as root can access all files. Perhaps you can
> deal with files permissions to avoid that but I would rather advise you to
> run these command as root or specifying a username with -U to switch user
>
> Regarding first command which was to add some user, I expect same issue:
> the command must write something in files (in your users database, the new
> user) and it can't as you are not root.
>
> Retry using sudo or after switching to root account.
>
> Cheers,
>
> mathias
>
> 2015-11-10 12:37 GMT+01:00 Rowland Penny <rowlandpenny241155 at gmail.com>:
>
>> On 10/11/15 10:49, edward torvalds wrote:
>>
>>> I having trouble with use samba-tool command. It just does not works. I
>>> need help with troubleshooting
>>>
>>> Commands I have tried:
>>>
>>> sudo samba-tool user create edward
>>> New Password:
>>> Retype Password:
>>> ERROR(<type 'exceptions.ValueError'>): Failed to add user 'edward': -
>>> unable to parse dn string
>>> File "/usr/lib/python2.7/dist-packages/samba/netcmd/user.py", line
>>> 176, in run
>>> uid=uid, uidnumber=uid_number, gidnumber=gid_number, gecos=gecos,
>>> loginshell=login_shell)
>>> File "/usr/lib/python2.7/dist-packages/samba/samdb.py", line 343, in
>>> newuser
>>> dnsdomain = ldb.Dn(self,
>>> self.domain_dn()).canonical_str().replace("/", "")
>>>
>>> ----------------------------------------------
>>>
>>> samba-tool user list
>>> ltdb: tdb(/var/lib/samba/private/sam.ldb): tdb_open_ex: could not open
>>> file /var/lib/samba/private/sam.ldb: Permission denied
>>>
>>> Unable to open tdb '/var/lib/samba/private/sam.ldb': Permission denied
>>> Failed to connect to 'tdb:///var/lib/samba/private/sam.ldb' with
>>> backend 'tdb': Unable to open tdb '/var/lib/samba/private/sam.ldb':
>>> Permission denied
>>> ERROR(ldb): uncaught exception - Unable to open tdb
>>> '/var/lib/samba/private/sam.ldb': Permission denied
>>> File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py",
>>> line 175, in _run
>>> return self.run(*args, **kwargs)
>>> File "/usr/lib/python2.7/dist-packages/samba/netcmd/user.py", line
>>> 265, in run
>>> credentials=creds, lp=lp)
>>> File "/usr/lib/python2.7/dist-packages/samba/samdb.py", line 56, in
>>> __init__
>>> options=options)
>>> File "/usr/lib/python2.7/dist-packages/samba/__init__.py", line 114,
>>> in __init__
>>> self.connect(url, flags, options)
>>> File "/usr/lib/python2.7/dist-packages/samba/samdb.py", line 71, in
>>> connect
>>> options=options)
>>>
>>>
>>> I don't know where to start troubleshooting from.
>>> Thanks
>>>
>> Where are you trying to create the user, on the DC or a domain member?
>>
>> Rowland
>>
>>
>>
>> --
>> To unsubscribe from this list go to the following URL and read the
>> instructions: https://lists.samba.org/mailman/options/samba
>>
What I was trying to ascertain, is the OP trying to run the command on a
domain member (in which case, it will never work as is) or on the DC.
Rowland
More information about the samba
mailing list