Fedora 28
Sponsored Link

Samba AD DC : サーバーの設定2018/05/13

 
Samba による Active Directory Domain Controller を構築します。
Samba 4.7 で MIT Kerberos サポートが実装されたため、RedHat系の Samba RPM パッケージでも DC 機能が提供されるようになりました。
(Fedora 27 の Samba パッケージから実装) (Samba 4.6 以前は Heimdal Kerberos のみサポート)
例として、以下のようなドメイン環境で設定します。
ドメイン名 : SMB01
レルム : SRV.WORLD
ホスト名 : smb.srv.world
[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でOK)

Realm [SRV.WORLD]:
# ドメイン名を指定

Domain [SRV]:
SMB01

# DC にするのでそのまま Enter

Server Role (dc, member, standalone) [dc]:
# Samba の内蔵 DNS を使うのでそのまま Enter

DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:
# DNS の参照先を確認して、OKであればそのまま Enter

DNS forwarder IP address (write 'none' to disable forwarding) [10.0.0.10]:
# 管理者パスワードを設定

# 単純なパスワードはエラーとなるため、6文字以上且つ英数字と大文字小文字を交えた複雑なパスワードにする

Administrator password:
Retype password:
Looking up IPv4 addresses
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=srv,DC=world
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=srv,DC=world
Creating DomainDnsZones and ForestDnsZones partitions
Populating DomainDnsZones and ForestDnsZones partitions
Setting up sam.ldb rootDSE marking as synchronized
Fixing provision GUIDs
The Kerberos KDC configuration for Samba AD is located at /var/lib/samba/private/kdc.conf
A Kerberos configuration suitable for Samba AD has been generated at /var/lib/samba/private/krb5.conf
Merge the contents of this file with your system krb5.conf or replace it with this one. Do not create a symlink!
Once the above files are installed, your Samba AD server will be ready to use
Server Role:           active directory domain controller
Hostname:              smb
NetBIOS Domain:        SMB01
DNS Domain:            srv.world
DOMAIN SID:            S-1-5-21-3229732968-1811224265-3683764017

[root@smb ~]#
cp /var/lib/samba/private/krb5.conf /etc/

[root@smb ~]#
systemctl start samba

[root@smb ~]#
systemctl enable 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) 2008 R2

# ドメインにユーザー登録

[root@smb ~]#
samba-tool user create fedora

New Password:  
# パスワード設定

Retype Password:
User 'fedora' created successfully
[4] Firewalld を有効にしている場合は 関連サービスの許可が必要です。
[root@smb ~]#
firewall-cmd --add-service={dns,kerberos,kpasswd,ldap,ldaps,samba} --permanent

success
[root@smb ~]#
firewall-cmd --add-port={135/tcp,137-138/udp,139/tcp,3268-3269/tcp,49152-65535/tcp} --permanent

success
[root@smb ~]#
firewall-cmd --reload

success
関連コンテンツ