openSUSE Leap 16

Samba AD DC : サーバーの設定2025/12/01

 

Samba による Active Directory Domain Controller を構築します。

例として、以下のようなドメイン環境で設定します。

ドメイン名 : SMB01
レルム : SRV.WORLD
ホスト名 : smb.srv.world

[1] Samba DC パッケージをインストールします。
smb:~ #
zypper -n install samba samba-ad-dc
[2] Samba の設定です。
smb:~ #
mv /etc/samba/smb.conf /etc/samba/smb.conf.org

smb:~ #
samba-tool domain provision

# レルム名を確認 または 変更して Enter
Realm [SRV.WORLD]: 
# ドメイン名を確認 または 変更して Enter
Domain [SRV]: SMB01 
# サーバーロールを確認 または 変更して Enter
# ドメインコントローラーは [dc]
Server Role (dc, member, standalone) [dc]:
# DNS バックエンドを確認 または 変更して Enter
DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:
# DNS フォワーダーを確認 または 変更して Enter
DNS forwarder IP address (write 'none' to disable forwarding) [10.0.0.10]: 
# 管理者パスワードを設定
Administrator password:
Retype password:

.....
.....

Applied Domain Update 85: e6d5fd00-385d-4e65-b02d-9da3493ed850
Applied Domain Update 86: 3a6b3fbf-3168-4312-a10d-dd5b3393952d
Applied Domain Update 87: 7f950403-0ab3-47f9-9730-5d7b0269f9bd
Applied Domain Update 88: 434bb40d-dbc9-4fe7-81d4-d57229f7b080
Applied Domain Update 89: a0c238ba-9e30-4ee6-80a6-43f731e9a5cd


smb:~ #
vi /etc/samba/smb.conf
[global]
        dns forwarder = 10.0.0.10
        netbios name = SMB
        realm = SRV.WORLD
        server role = active directory domain controller
        workgroup = SMB01
        # [global] セクションに以下追記
        ad dc functional level = 2016

smb:~ #
cp /var/lib/samba/private/krb5.conf /etc/

smb:~ #
nmcli connection modify enp1s0 ipv4.dns 127.0.0.1

smb:~ #
nmcli connection up enp1s0

smb:~ #
systemctl enable --now samba-ad-dc
smb:~ #
samba-tool domain info smb.srv.world

Forest           : srv.world
Domain           : srv.world
Netbios domain   : SMB01
DC name          : smb.srv.world
DC netbios name  : SMB
Server site      : Default-First-Site-Name
Client site      : Default-First-Site-Name
[3] ドメインの機能レベルの確認とユーザー登録をしておきます。
smb:~ #
samba-tool domain level show

Domain and forest function level for domain 'DC=srv,DC=world'

Forest function level: (Windows) 2008 R2
Domain function level: (Windows) 2008 R2
Lowest function level of a DC: (Windows) 2016

# 機能レベルを 2016 に上げる

smb:~ #
samba-tool domain functionalprep --function-level=2016

smb:~ #
samba-tool domain level raise --domain-level=2016 --forest-level=2016

Domain function level changed!
Forest function level changed!
All changes applied successfully!

smb:~ #
samba-tool domain level show

Domain and forest function level for domain 'DC=srv,DC=world'

Forest function level: (Windows) 2016
Domain function level: (Windows) 2016
Lowest function level of a DC: (Windows) 2016

# ドメインユーザー登録

smb:~ #
samba-tool user create suse

New Password:     # パスワード設定
Retype Password:
User 'suse' added successfully
[4] Firewalld は停止します。
smb:~ #
systemctl disable --now firewalld

関連コンテンツ