Samba AD DC : サーバーの設定2025/11/18 |
|
Samba による Active Directory Domain Controller を構築します。 例として、以下のようなドメイン環境で設定します。
|
|||||||
| [1] | Samba DC パッケージをインストールします。 |
|
[root@smb ~]# dnf -y install samba samba-dc
|
| [2] | Samba の設定です。 |
|
[root@smb ~]# mv /etc/samba/smb.conf /etc/samba/smb.conf.org [root@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) [127.0.0.53]: 10.0.0.10 # 管理者パスワードを設定 Administrator password: Retype password: ..... ..... Applied Domain Update 84: e5f9e791-d96d-4fc9-93c9-d53e1dc439ba 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
[root@smb ~]#
vi /etc/samba/smb.conf
[global]
dns forwarder = 127.0.0.53
netbios name = SMB
realm = SRV.WORLD
server role = active directory domain controller
workgroup = SMB01
# [global] セクションに以下追記
ad dc functional level = 2016
[root@smb ~]# cp /var/lib/samba/private/krb5.conf /etc/ [root@smb ~]# unlink /etc/resolv.conf [root@smb ~]# systemctl disable --now systemd-resolved [root@smb ~]# nmcli connection modify enp1s0 ipv4.dns 127.0.0.1 [root@smb ~]# nmcli connection up enp1s0 [root@smb ~]# systemctl enable --now samba |
| [3] | ドメインの機能レベルの確認とユーザー登録をしておきます。 |
|
[root@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 に上げる [root@smb ~]# samba-tool domain functionalprep --function-level=2016 [root@smb ~]# samba-tool domain level raise --domain-level=2016 --forest-level=2016 Domain function level changed! Forest function level changed! All changes applied successfully![root@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 # ドメインユーザー登録 [root@smb ~]# samba-tool user create fedora
New Password: # パスワード設定
Retype Password:
User 'fedora' added successfully
|
| [4] | Firewalld は停止します。 |
|
[root@smb ~]# systemctl disable --now firewalld |
| Sponsored Link |
|
|