4 Управление Samba 4 Active Directory с клиента Windows

4 Управление Samba 4 Active Directory с клиента Windows

One of Samba 4’s goals is to integrate with (and replace) Active Directory as a system. At this point, if everything has worked correctly you should have an «Administrative Tools» menu under Programs. If, under Administrative Tools you have «Active Directory Users and Computers», that is a very good sign. Most times, if there is a configuration or bug in Samba, the AD Users & Computers (among other interfaces) won’t show up as an option. You can run it by hand (Start->Run->dsa.msc) but it’s unlikely to work correctly.

Одной из целей Samba 4 является интеграция с Active Directory (или его замена). Если все настроено правильно, то у вас в разделе программы появится меню «Administrative Tools». Также очень хорошо если в разделе Administrative Tools есть меню «Active Directory Users and Computers». Очень часто оснастка «Active Directory Users and Computers» не отображается в папке Administrative Tools среди других оснасток. Это происходит из за ошибок при настройке или из-за багов в Samba. Вы можете запустить ее вручную (Пуск ? Выполнить ? dsa.msc), но врядли она будет корректно работать в этом случае. Eng.

4.1 Шаг 1: Добавление пользователей в Samba 4 Active Directory

Unlike Samba 3, Samba 4 does not require a local Unix user for each Samba user that is created.

В Samba 4 (в отличие от Samba 3) не требуется создавать локальных пользователей Unix для вновь создаваемых пользователей Samba. Eng.

To create a Samba user, use the following command:

Пользователь в Samba создается командой: Eng.

 /usr/local/samba/bin/samba-tool user add USERNAME

To inspect the allocated user ID and SID, use the following command:

Узнать выделенный пользователю ID И SID можно можно выполнив команды: Eng.

 $ /usr/local/samba/bin/wbinfo --name-to-sid USERNAME
 S-1-5-21-4036476082-4153129556-3089177936-1005 SID_USER (1)
 $ /usr/local/samba/bin/wbinfo --sid-to-uid S-1-5-21-4036476082-4153129556-3089177936-1005
 3000011

If you want to change this mapping, then use ldbedit on the /usr/local/samba/private/idmap.ldb, as shown:

Для изменения этого соответствия используйте утилиту ldbedit. Она предназначена для редактирования базы /usr/local/samba/private/idmap.ldb, см. пример: Eng.

 $ ldbedit -e emacs -H /usr/local/samba/private/idmap.ldb objectsid=S-1-5-21-4036476082-4153129556-3089177936-1005

*Note: You can replace emacs with your editor of choice.

Замечание: Вы можете заменить редактор emacs своим редактором. Eng.

You will find records that look like this:

Найдите записи как в примере ниже: Eng.

 # record 1
 dn: CN=S-1-5-21-4036476082-4153129556-3089177936-1005
 cn: S-1-5-21-4036476082-4153129556-3089177936-1005
 objectClass: sidMap
 objectSid: S-1-5-21-4036476082-4153129556-3089177936-1005
 type: ID_TYPE_BOTH
 xidNumber: 3000011
 distinguishedName: CN=S-1-5-21-4036476082-4153129556-3089177936-1005

If you change the xidNumber attribute and save your editor then exit, then Samba will update the mapping to between the SID and the user ID. Updating group mappings works in the same way.

Измените атрибут xidNumber и сохраните изменения при выходе из вашего редактора. Samba обновит соответствие между SID и пользовательским ID. Также можно обновить соответствие для группы. Eng.

*Note: You can also manage users using the normal Windows AD user management tools.

Замечание: Также вы можете редактировать пользователей через оснастку Windows AD user management tools. Eng.