ActiveDirectory/DC: различия между версиями
Нет описания правки |
|||
Строка 97: | Строка 97: | ||
chkconfig samba on | chkconfig samba on | ||
service samba start | service samba start | ||
= Проверка работоспособности = | |||
1. Общая информация о домене: | |||
<source lang="text"># samba-tool domain info 127.0.0.1 | |||
Forest : school.alt | |||
Domain : school.alt | |||
Netbios domain : SCHOOL | |||
DC name : c228.school.alt | |||
DC netbios name : C228 | |||
Server site : Default-First-Site-Name | |||
Client site : Default-First-Site-Name</source> | |||
2. Просмотр предоставляемых служб: | |||
<source lang="text"># smbclient -L localhost -Uadministrator | |||
Enter administrator's password: | |||
Domain=[SCHOOL] OS=[Unix] Server=[Samba 4.0.21] | |||
Sharename Type Comment | |||
--------- ---- ------- | |||
netlogon Disk | |||
sysvol Disk | |||
IPC$ IPC IPC Service (Samba 4.0.21) | |||
Domain=[SCHOOL] OS=[Unix] Server=[Samba 4.0.21] | |||
Server Comment | |||
--------- ------- | |||
Workgroup Master | |||
--------- ------- | |||
SCHOOL.ALT C228 | |||
WORKGROUP HOST-15</source> | |||
3. Проверка конфигурации DNS: | |||
<source lang="text"># host -t SRV _kerberos._udp.school.alt. | |||
_kerberos._udp.school.alt has SRV record 0 100 88 c228.school.alt. | |||
# host -t SRV _ldap._tcp.school.alt. | |||
_ldap._tcp.school.alt has SRV record 0 100 389 c228.school.alt. | |||
# host -t A c228.school.alt. | |||
c228.school.alt has address 192.168.1.1</source> | |||
Если имена не находятся, проверяйте выключение службы {{cmd|named}}. | |||
4. Проверка Kerberos: | |||
<source lang="text"># kinit administrator@SCHOOL.ALT | |||
Password for administrator@SCHOOL.ALT: | |||
Warning: Your password will expire in 41 days on Вт 11 ноя 2014 08:58:30</source> | |||
Просмотр полученного билета: | |||
<source lang="text"># klist | |||
Ticket cache: FILE:/tmp/krb5cc_0 | |||
Default principal: administrator@SCHOOL.ALT | |||
Valid starting Expires Service principal | |||
30.09.2014 10:23:54 30.09.2014 20:23:54 krbtgt/SCHOOL.ALT@SCHOOL.ALT | |||
renew until 01.10.2014 10:23:45</source> | |||
= Ссылки = | = Ссылки = |
Версия от 09:25, 30 сентября 2014
Использование Samba 4 в роли контроллера домена Active Directory.
Установка
1. Так как Samba в режиме контроллера домена (Doman Controller, DC) использует как свой LDAP, так и свой сервер Kerberos, несовместимый с MIT Kerberos, перед установкой остановите конфликтующие службы krb5kdc и slapd:
chkconfig krb5kdc off service krb5kdc stop chkconfig slapd off service slapd stop
2. Установите пакеты samaba-DC, которые конфликтуют с обычной samba:
apt-get install samba-DC python-module-samba-DC samba-DC-common samba-DC-winbind-clients samba-DC-winbind
удаляются пакеты:
alt-domain-server alterator-auth alterator-ldap-groups alterator-ldap-users alterator-openldap alterator-squid host2cat ldap-user-tools libnetapi libsmbclient libwbclient netpolice-main openresolv-host2cat samba samba-client samba-common samba-libs samba-winbind samba-winbind-clients squid-conf-host2cat squid-helpers
Миграция существующего сервера
На базе https://wiki.samba.org/index.php/Samba4/samba-tool/domain/classicupgrade/HOWTO
1. Скопируем для миграции данные в один каталог:
mkdir /var/lib/samba/dbdir
cp -pv /var/lib/samba/private/* /var/lib/samba/dbdir
cp -pv /var/lib/samba/{account_policy,gencache_notrans,group_mapping}.tdb /var/lib/samba/dbdir
Должно скопироваться пять файлов .tdb
2. Под root запустим classicupgrade:
samba-tool domain classicupgrade --dbdir=/var/lib/samba/dbdir --use-xattrs=yes --realm=school.alt /etc/samba/smb.conf
Запуск нового сервера
В примере показано создание домена school.alt.
1. Удалите файл /etc/samba/smb.conf, потому что для samba-DC будет создан новый файл конфигурации:
rm -f /etc/samba/smb.conf
2. Запустите samba-tool domain provision:
# samba-tool domain provision
Realm [SCHOOL.ALT]:
Domain [SCHOOL]:
Server Role (dc, member, standalone) [dc]:
DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:
DNS forwarder IP address (write 'none' to disable forwarding) [127.0.0.1]:
Administrator password:
Retype password:
Looking up IPv4 addresses
More than one IPv4 address found. Using 192.168.1.1
Looking up IPv6 addresses
No IPv6 address will be assigned
Setting up share.ldb
Setting up secrets.ldb
Setting up the registry
Setting up the privileges database
Setting up idmap db
Setting up SAM db
Setting up sam.ldb partitions and settings
Setting up sam.ldb rootDSE
Pre-loading the Samba 4 and AD schema
Adding DomainDN: DC=school,DC=alt
Adding configuration container
Setting up sam.ldb schema
Setting up sam.ldb configuration data
Setting up display specifiers
Modifying display specifiers
Adding users container
Modifying users container
Adding computers container
Modifying computers container
Setting up sam.ldb data
Setting up well known security principals
Setting up sam.ldb users and groups
Setting up self join
Adding DNS accounts
Creating CN=MicrosoftDNS,CN=System,DC=school,DC=alt
Creating DomainDnsZones and ForestDnsZones partitions
Populating DomainDnsZones and ForestDnsZones partitions
Setting up sam.ldb rootDSE marking as synchronized
Fixing provision GUIDs
A Kerberos configuration suitable for Samba 4 has been generated at /var/lib/samba/private/krb5.conf
Once the above files are installed, your Samba4 server will be ready to use
Server Role: active directory domain controller
Hostname: c228
NetBIOS Domain: SCHOOL
DNS Domain: school.alt
DOMAIN SID: S-1-5-21-80639820-2350372464-3293631772
При запросе ввода нажимайте Enter за исключением запроса пароля администратора («Administrator password:» и «Retype password:»).
Запуск службы
Установите службу по умолчанию и запустите её:
chkconfig samba on service samba start
Проверка работоспособности
1. Общая информация о домене:
# samba-tool domain info 127.0.0.1
Forest : school.alt
Domain : school.alt
Netbios domain : SCHOOL
DC name : c228.school.alt
DC netbios name : C228
Server site : Default-First-Site-Name
Client site : Default-First-Site-Name
2. Просмотр предоставляемых служб:
# smbclient -L localhost -Uadministrator
Enter administrator's password:
Domain=[SCHOOL] OS=[Unix] Server=[Samba 4.0.21]
Sharename Type Comment
--------- ---- -------
netlogon Disk
sysvol Disk
IPC$ IPC IPC Service (Samba 4.0.21)
Domain=[SCHOOL] OS=[Unix] Server=[Samba 4.0.21]
Server Comment
--------- -------
Workgroup Master
--------- -------
SCHOOL.ALT C228
WORKGROUP HOST-15
3. Проверка конфигурации DNS:
# host -t SRV _kerberos._udp.school.alt.
_kerberos._udp.school.alt has SRV record 0 100 88 c228.school.alt.
# host -t SRV _ldap._tcp.school.alt.
_ldap._tcp.school.alt has SRV record 0 100 389 c228.school.alt.
# host -t A c228.school.alt.
c228.school.alt has address 192.168.1.1
Если имена не находятся, проверяйте выключение службы named.
4. Проверка Kerberos:
# kinit administrator@SCHOOL.ALT
Password for administrator@SCHOOL.ALT:
Warning: Your password will expire in 41 days on Вт 11 ноя 2014 08:58:30
Просмотр полученного билета:
# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: administrator@SCHOOL.ALT
Valid starting Expires Service principal
30.09.2014 10:23:54 30.09.2014 20:23:54 krbtgt/SCHOOL.ALT@SCHOOL.ALT
renew until 01.10.2014 10:23:45