CentOS 7
Sponsored Link

Samba AD DC : Install
Configure Samba Active Directory Domain Controller.
The Samba package provided from official repository does not provide the DC function yet, so Download Samba RPM package from the EnterpriseSAMBA.com ( http://enterprisesamba.com/ ) which is introduced by Samba official site ( https://www.samba.org/ ).
Register your user info on the site below first to download Samba RPM package.
After registration, access to the URL above again and click 'Login' to login the site.
After login, remember your username and accesskey which is displayed on the site. It's necessarry to set in repo file for yum later.
Scroll down the page and download 'sernet-samba-4.1.repo' for CentOS 7 to your PC or server. Next, upload it to the server you will install Samba4 and move it under the '/etc/yum.repos.d'.
[5] Set your username and accesskey in repo file.
[[email protected] ~]#
vi /etc/yum.repos.d/sernet-samba-4.1.repo
# change to your username and accesskey

name=SerNet Samba 4.1 Packages (centos-7)
[6] Install Samba.
[[email protected] ~]#
yum -y install sernet-samba sernet-samba-ad
[7] Configure Samba AD DC.
[[email protected] ~]#
samba-tool domain provision

# specify Realm

Realm [SRV.WORLD]:

# specify Domain name

Domain [SERVER]:

# Enter with default because it sets DC

Server Role (dc, member, standalone) [dc]:
# Enter with default because it uses Built-in DNS

# confirm DNS setting and Enter if it's OK

DNS forwarder IP address (write 'none' to disable forwarding) []:
# set admin password

# Do not set trivial password, if you input it, configuration wizard shows error and stops.

Administrator password:
Retype password:
Looking up IPv4 addresses
Looking up IPv6 addresses
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:              smb
NetBIOS Domain:        SMB01
DNS Domain:            srv.world
DOMAIN SID:            S-1-5-21-1554426047-3808867033-1778000025

[[email protected] ~]#
vi /etc/default/sernet-samba
# line 7: change

[[email protected] ~]#
cp /var/lib/samba/private/krb5.conf /etc/krb5.conf

[[email protected] ~]#
systemctl start sernet-samba-ad

[[email protected] ~]#
chkconfig sernet-samba-ad on

[[email protected] ~]#
chkconfig sernet-samba-smbd off

[[email protected] ~]#
chkconfig sernet-samba-nmbd off

[[email protected] ~]#
chkconfig sernet-samba-winbindd off

[8] Raise the domain level to 2008 R2.
[[email protected] ~]#
samba-tool domain level raise --domain-level 2008_R2 --forest-level 2008_R2

Domain function level changed!
Forest function level changed!
All changes applied successfully!
# show domain level

[[email protected] ~]#
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