Примечание
# apt-get install task-samba-dc
/etc/resolv.conf
обязательно должен быть добавлен первый DC как nameserver:
#echo "name_servers=192.168.0.122" >> /etc/resolvconf.conf
#echo "search_domains=test.alt" >> /etc/resolvconf.conf
#resolvconf -u
#cat /etc/resolv.conf
search test.alt nameserver 192.168.0.122 nameserver 8.8.8.8
# for service in smb nmb krb5kdc slapd bind; do systemctl disable $service; systemctl stop $service; done
#rm -f /etc/samba/smb.conf
#rm -rf /var/lib/samba
#rm -rf /var/cache/samba
#mkdir -p /var/lib/samba/sysvol
# samba-tool dns add 192.168.0.122 test.alt DC2 A 192.168.0.123 -Uadministrator
Password for [TEST\administrator]:
Record added successfully
Предупреждение
Примечание
samba-tool dns add
см. в разделе Администрирование DNS
/etc/krb5.conf
):
[libdefaults] default_realm = TEST.ALT dns_lookup_realm = false dns_lookup_kdc = true
# kinit administrator@TEST.ALT
Password for administrator@TEST.ALT:
Предупреждение
# klist
Ticket cache: KEYRING:persistent:0:0
Default principal: administrator@TEST.ALT
Valid starting Expires Service principal
27.03.2024 14:14:36 28.03.2024 00:14:36 krbtgt/TEST.ALT@TEST.ALT
renew until 28.03.2024 14:14:32
# samba-tool domain join
test.alt DC -Uadministrator \
--realm=test.alt --dns-backend=BIND9_DLZ
Если всё нормально, в конце будет выведена информация о присоединении к домену:
Joined domain TEST (SID S-1-5-21-80639820-2350372464-3293631772) as a DC
#systemctl enable --now samba
#systemctl enable --now bind