samba retrieving users with arbitrary attributes

1.7k views Asked by At

I'm trying to import users to samba using the samba-tool. I can add users with arbitrary attributes, let's say the test-user has a phone, a job title etc. From samba wiki I found the following snippet, which has some custom attributes:

:~$ sudo samba-tool user add test3 agoodpasswd,12 --telephone="+16901234567" --job-title="Samba learner"
Global parameter server role found in service section!
Global parameter dns forwarder found in service section!
User 'test3' created successfully

But, the wbinfo -i test3 doesn't return the telephone and job title. Any idea how can I get back those attributes?

1

There are 1 answers

0
Michael Adam On

wbinfo shows only the uinx/posix user attributes, which don't include these fields. The extra attributes are stored in the directory (AD) and can be looked at with ldap-like tools, e.g. the user properties GUI on windows (using RSAT). Locally, on the server you can look at the records in the directory like this:

sudo ldbsearch -H /var/lib/samba/private/sam.ldb CN=user1

This assumes that you have installed samba from distribution packages. You may have to change the location of the file. You can also use the network with ldbtools:

ldbsearch -H ldap://127.0.0.1 -Uadministrator CN=user1

and you need to type the admin pass at the prompt (alternatively, you can specify it as -Uadministrator%password like with other samba tools).