Аутентификация файловых серверов GNU/Linux в домене Windows на базе AD. Часть 2 / Хабр

Конфигурационные файлы.

Мы будем настраивать только доступ к серверу GNU/Linux с использованием Samba. Авторизация пользователей останется локальной, с использованием /etc/passwd.

Мы присвоим нашему новому серверу статический IP-адрес. Пусть им будет 192.168.7.9.

Для начала нужно проверить, какой сервер у нас используется в качестве DNS. Им в нашей сети должен быть контроллер домена. У нас адрес сервера определен как 192.168.7.2. Правим файл /etc/resolv.conf. Он должен выглядеть следующим образом:

search lab.local
nameserver 192.168.7.2


Проверим, все ли работает:

#host 192.168.7.2
2.7.168.192.in-addr.arpa domain name pointer lab-dc1.lab.local.
#

Естественно, в Вашем случае имена будут другими. Обязательно сделайте в домене lab.local запись в DNS, ссылающуюся на наш новый сервер. Запись в DNS не означает того, что наш GNU/Linux сервер включен в домен. Проверим:

linux-test:~ # host 192.168.7.9
9.7.168.192.in-addr.arpa domain name pointer test-linux.lab.local.
linux-test:~ # host test-linux
test-linux.lab.local has address 192.168.7.9
linux-test:~ #

Для корректной работы в домене Windows требуется несколько служб: Kerberos, LDAP и Samba. В общем случае требуется только настройка Samba, настройка других служб не является обязательной. Но будет лучше, если мы их настроим – они могут пригодиться в будущем.

Kerberos настраивается просто – через один файл /etc/krb5.conf. Основными параметрами является REALM, указывающий на наш домен и адрес сервера Kerberos – это адрес контроллера домена. Файл /etc/krb5.conf выглядит примерно так:

Проверка работоспособности.


Здесь мы проверим корректность наших настроек и включим наш новый сервер в домен Windows. Сначала проверим корректность настройки Samba:

Changes required on domain member¶

In order to configure the domain member part of Samba suite, following steps
need to be preformed. These steps are implemented as an installer utility
ipa-client-samba and are provided here for documentation purpose only.

Assumptions:

Next steps should be performed on the client itself. With the support for Samba
domain member enabled, IPA masters allow creation of the required records with
the host credentials (host/${hostname}).

Configure samba to use freeipa auth

When freeipa adjusts the samba config, it will just make it use the registry backend. You can view the equivalent conf file with testparm.Here is a complete /etc/samba/smb.conf.

Deleting an acl

To delete an ACL, pass the –delete parameter with the exact ACL to the smbcacls utility. For example:

Domain controller side configuration overview¶

See samba-domain-controller for the details of how Samba domain controller is
set up and configured in FreeIPA.

Domain member configuration overview¶

Samba suite, when running as a domain member, starts two daemons:

Get localsid

Get the local SID

net getlocalsid

Granting privileges

To grant a privilege to an account or group, use the net rpc rights grant command.

Install freeipa server (and replica)

You need a working freeipa environment, which is outside the scope of this document. A quick sample installation process is:

Listing privileges you can set

To list all available privileges and their owners, use the net rpc rights list command. For example:

On the freeipa controller

yum -y install ipa-server-trust-ad
ipa-adtrust-install --add-sids

I recommend running this interactively, as shown above. Let it overwrite your samba config. It will configure it to use the registry, and we will rewrite it to suit the demands here.The ipa-adtrust-install command generates the records you need to add to dns. They will look like:

On the samba server

Install the ipa-server-trust-ad package on the samba server. You need this package there to get the ipasam config option in smb.conf.

yum -y install ipa-server-trust-ad

Open the firewall for the ports mentioned in the output of the command. You can use this script.

Package-aware drivers

Samba does not support package-aware drivers.

Preparing a printer driver for being uploaded

Before you can upload a driver to a Samba print server:


Ask your printer manufacturer for drivers that support uploading to a print server.

Revoking privileges

To revoke a privilege from an account or group, use the net rpc rights revoke command.

Supported driver model version

Samba only supports the printer driver model version 3 which is supported in Windows 2000 and later, and Windows Server 2000 and later. Samba does not support the driver model version 4, introduced in Windows 8 and Windows Server 2022. However, these and later Windows versions also support version 3 drivers.

Updating an acl

Updating an ACL is similar to adding a new ACL. You update an ACL by overriding the ACL using the –modify parameter with an existing security principal. If smbcacls finds the security principal in the ACL list, the utility updates the permissions. Otherwise the command fails with an error:

ACL for SID principal_name not found
Похожее:  Обещанный платеж сибирские сети

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *