Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
TetraWiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
GSTN - Smaba PDC document
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
[[category:GSTN]] <div style="color:#00000a;"></div> <div style="color:#00000a;"></div> <div style="color:#00000a;"></div> <div style="color:#00000a;"></div> <div style="color:#00000a;"></div> <div style="color:#00000a;"></div> <div style="color:#00000a;"></div> <div style="color:#00000a;"></div> Samba AD As is Build for Domain Controller installation Date : 08.08.2016 Document Version : 1.0 Table of Contents[[#RefHeading2063957709649|1.Setup a Samba Active Directory Domain Controller]] :[[#RefHeading2065957709649|1.1.Configure yum repository for Packages installation.]] :[[#RefHeading2067957709649|1.2.Assign the Ipv4 address and restart the network services.]] :[[#RefHeading2069957709649|1.3.Assign the Ipv6 address and restart the network services. And set hostname.]] :[[#RefHeading2071957709649|1.4.Edit /etc/hosts file and make below entries.]] :[[#RefHeading2073957709649|1.5.Restart network service.]] :[[#RefHeading2075957709649|1.6.Reboot server.]] :[[#RefHeading2077957709649|1.7.Install Dependencies for samba installation.]] :[[#RefHeading2079957709649|1.8.Dependencies Installation is completed.]] [[#RefHeading2081957709649|2.Samba Installation]] :[[#RefHeading2083957709649|2.1.Download samba file from https://www.samba.org/ and extract it.]] :[[#RefHeading2085957709649|2.2.Enter in samba-4.4.4 directory and run configure command.]] :[[#RefHeading2087957709649|2.3.Run make command.]] :[[#RefHeading2089957709649|2.4.Run make install command.]] :[[#RefHeading2091957709649|2.5.Provision a new domain:]] :[[#RefHeading2093957709649|2.6.Provisioning completed successfully.]] [[#RefHeading2095957709649|3.Initialisation]] :[[#RefHeading2097957709649|3.1.Samba doesn't yet have init scripts included]] :[[#RefHeading2099957709649|3.2.Set the permissions on samba4 file.]] :[[#RefHeading2101957709649|3.3.Restart samba]] :[[#RefHeading2103957709649|3.4.Run "smbclient"]] :[[#RefHeading2105957709649|3.5.Open /etc/named.conf file.]] :[[#RefHeading2107957709649|3.6.DNS keytab]] :[[#RefHeading2109957709649|3.7.Also make below entry in named.conf]] :[[#RefHeading2111957709649|3.8.Change the owner ship as below and restart named services.]] :[[#RefHeading2113957709649|3.9.Copy Kerberos]]<div style="color:#00000a;"></div> = Setup a Samba Active Directory Domain Controller = == Configure yum repository for Packages installation. == <div style="color:#00000a;">Edit /etc/yum.repos.d/local.repo </div> <div style="color:#00000a;"><nowiki># vi /etc/yum.repos.d/local.repo </nowiki></div> [[Image:Picture.png]] <div style="color:#00000a;">Make below entries. Save file and exit.</div> <div style="color:#00000a;">[local]</div> <div style="color:#00000a;">name=local</div> <div style="color:#00000a;">baseurl=file:///mnt</div> <div style="color:#00000a;">gpgcheck=0</div> <div style="color:#00000a;">enabled=1</div> [[Image:Image1.png]] == Assign the Ipv4 address and restart the network services. == <div style="color:#00000a;"><nowiki># nmcli connection modify eth0 ipv4.addresses 172.18.101.14/24 ipv4.method manual ipv4.gateway 172.18.101.1 connection.autoconnect yes ipv4.dns 172.18.101.14</nowiki></div> <div style="color:#00000a;"><nowiki># systemctl restart network.service</nowiki></div> [[Image:Image2.png]] == Assign the Ipv6 address and restart the network services. And set hostname. == <div style="color:#00000a;"><nowiki># nmcli connection modify eth0 ipv6.addresses 2404:a800:1000:d:7800::e/69 ipv6.method manual ipv6.gateway 2404:a800:1000:d:7800::1 connection.autoconnect yes ipv6.dns 2404:a800:1000:d:7800::e</nowiki></div> <div style="color:#00000a;"><nowiki># hostnamectl set-hostname gd9103.gstn.local</nowiki></div> [[Image:Image3.png]]== Edit /etc/hosts file and make below entries. == <div style="color:#00000a;"><nowiki># vi /etc/hosts</nowiki></div> <div style="color:#00000a;">172.18.101.14gd9103.gstn.localgd9103</div> <div style="color:#00000a;"></div> <div style="color:#00000a;">2404:a800:1000:d:7800::egd9103.gstn.localgd9103</div> [[Image:Image4.png]] == Restart network service. == <div style="color:#00000a;"><nowiki># systemctl restart network.service</nowiki></div> [[Image:Image5.png]] == Reboot server. == <div style="color:#00000a;"><nowiki># init 6</nowiki></div> [[Image:Image6.png]]== Install Dependencies for samba installation. == <div style="color:#00000a;"><nowiki># yum install perl gcc attr libacl-devel libblkid-devel gnutls-devel readline-devel python-devel gdb pkgconfig krb5-workstation zlib-devel setroubleshoot-server libaio-devel setroubleshoot-plugins policycoreutils-python libsemanage-python perl-ExtUtils-MakeMaker perl-Parse-Yapp perl-Test-Base popt-devel libxml2-devel libattr-devel keyutils-libs-devel cups-devel bind-utils libxslt docbook-style-xsl openldap-devel autoconf python-crypto pam-devel</nowiki></div> [[Image:Image7.png]]== Dependencies Installation is completed. == [[Image:Image8.png]] <div style="color:#00000a;"></div>= Samba Installation = == Download samba file from [https://www.samba.org/ https://www.samba.org/] and extract it. == <div style="color:#00000a;"><nowiki># tar xvzf samba-4.4.4.tar.gz</nowiki></div> [[Image:Image9.png]]== Enter in samba-4.4.4 directory and run configure command. == <div style="color:#00000a;"><nowiki># cd samba-4.4.4/</nowiki></div> <div style="color:#00000a;"><nowiki># ./configure</nowiki></div> [[Image:Image10.png]] <div style="color:#00000a;">Now configure done successfully.</div> [[Image:Image11.png]] == Run make command. == <div style="color:#00000a;"><nowiki># make</nowiki></div> [[Image:Image12.png]] <div style="color:#00000a;">Make command finished successfully.</div> [[Image:Image13.png]]== Run make install command. == <div style="color:#00000a;"><nowiki># make install</nowiki></div> [[Image:Image14.png]]== Provision a new domain: == <div style="color:#00000a;"><nowiki># /usr/local/samba/bin/samba-tool domain provision --use-rfc2307 --interactive</nowiki></div> [[Image:Image15.png]]== Provisioning completed successfully. == [[Image:Image16.png]] = {{anchor|RefHeading2095957709649}} Initialisation = == {{anchor|RefHeading2097957709649}} Samba doesn't yet have init scripts included == # we can copy script from below link. [https://wiki.samba.org/index.php/Samba4/InitScript https://wiki.samba.org/index.php/Samba4/InitScript] # create a file /etc/rc.d/init.d/samba4 <div style="color:#00000a;"></div> <div style="color:#00000a;"><nowiki># vi /etc/rc.d/init.d/samba4</nowiki></div> <div style="color:#00000a;">and paste the below content in this file. </div> <div style="color:#00000a;">________________________________</div> <div style="color:#00000a;"><nowiki>#! /bin/bash</nowiki></div> <div style="color:#00000a;"><nowiki>#</nowiki></div> <div style="color:#00000a;"><nowiki># samba4 Bring up/down samba4 service</nowiki></div> <div style="color:#00000a;"><nowiki>#</nowiki></div> <div style="color:#00000a;"><nowiki># chkconfig: - 90 10</nowiki></div> <div style="color:#00000a;"><nowiki># description: Activates/Deactivates all samba4 interfaces configured to \</nowiki></div> <div style="color:#00000a;"><nowiki># start at boot time.</nowiki></div> <div style="color:#00000a;"><nowiki>#</nowiki></div> <div style="color:#00000a;"><nowiki>### BEGIN INIT INFO</nowiki></div> <div style="color:#00000a;"><nowiki># Provides:</nowiki></div> <div style="color:#00000a;"><nowiki># Should-Start:</nowiki></div> <div style="color:#00000a;"><nowiki># Short-Description: Bring up/down samba4</nowiki></div> <div style="color:#00000a;"><nowiki># Description: Bring up/down samba4</nowiki></div> <div style="color:#00000a;"><nowiki>### END INIT INFO</nowiki></div> <div style="color:#00000a;"><nowiki># Source function library.</nowiki></div> <div style="color:#00000a;">. /etc/init.d/functions</div> <div style="color:#00000a;">if [ -f /etc/sysconfig/samba4 ]; then</div> <div style="color:#00000a;">. /etc/sysconfig/samba4</div> <div style="color:#00000a;">fi</div> <div style="color:#00000a;">CWD=$(pwd)</div> <div style="color:#00000a;">prog="samba4"</div> <div style="color:#00000a;">start() {</div> <div style="color:#00000a;"><nowiki># Attach irda device</nowiki></div> <div style="color:#00000a;">echo -n $"Starting $prog: "</div> <div style="color:#00000a;">/usr/local/samba/sbin/samba</div> <div style="color:#00000a;">sleep 2</div> <div style="color:#00000a;">if ps ax | grep -v "grep" | grep -q /samba/sbin/samba ; then success $"samba4 startup"; else failure $"samba4 startup"; fi</div> <div style="color:#00000a;">echo</div> <div style="color:#00000a;">}</div> <div style="color:#00000a;">stop() {</div> <div style="color:#00000a;"><nowiki># Stop service.</nowiki></div> <div style="color:#00000a;">echo -n $"Shutting down $prog: "</div> <div style="color:#00000a;">killall samba</div> <div style="color:#00000a;">sleep 2</div> <div style="color:#00000a;">if ps ax | grep -v "grep" | grep -q /samba/sbin/samba ; then failure $"samba4 shutdown"; else success $"samba4 shutdown"; fi</div> <div style="color:#00000a;">echo</div> <div style="color:#00000a;">}</div> <div style="color:#00000a;">status() {</div> <div style="color:#00000a;">/usr/local/samba/sbin/samba --show-build</div> <div style="color:#00000a;">}</div> <div style="color:#00000a;"><nowiki># See how we were called.</nowiki></div> <div style="color:#00000a;">case "$1" in</div> <div style="color:#00000a;">start)</div> <div style="color:#00000a;">start</div> <div style="color:#00000a;"><nowiki>;;</nowiki></div> <div style="color:#00000a;">stop)</div> <div style="color:#00000a;">stop</div> <div style="color:#00000a;"><nowiki>;;</nowiki></div> <div style="color:#00000a;">status)</div> <div style="color:#00000a;">status irattach</div> <div style="color:#00000a;"><nowiki>;;</nowiki></div> <div style="color:#00000a;">restart|reload)</div> <div style="color:#00000a;">stop</div> <div style="color:#00000a;">start</div> <div style="color:#00000a;"><nowiki>;;</nowiki></div> <div style="color:#00000a;"><nowiki>*)</nowiki></div> <div style="color:#00000a;">echo $"Usage: $0 {start|stop|restart|status}"</div> <div style="color:#00000a;">exit 1</div> <div style="color:#00000a;">esac</div> <div style="color:#00000a;">exit 0</div> <div style="color:#00000a;">______________________________________________________________________________</div> [[Image:Image17.png]] == {{anchor|RefHeading2099957709649}} Set the permissions on samba4 file. == <div style="color:#00000a;"><nowiki># chmod 755 /etc/rc.d/init.d/samba4</nowiki></div> <div style="color:#00000a;"><nowiki># chmod +x /etc/rc.d/init.d/samba4</nowiki></div> <div style="color:#00000a;"><nowiki># ln -s /etc/rc.d/init.d/samba4 /etc/rc3.d/S80samba4</nowiki></div> <div style="color:#00000a;"><nowiki># chkconfig --add samba4</nowiki></div> <div style="color:#00000a;"><nowiki># chkconfig samba4 on</nowiki></div> [[Image:Image18.png]]== {{anchor|RefHeading2101957709649}} Restart samba == <div style="color:#00000a;"><nowiki># service samba4 restart</nowiki></div> <div style="color:#00000a;">or ''systemctl start samba4.service''</div> [[Image:Image19.png]] == {{anchor|RefHeading2103957709649}} Run "smbclient" == <div style="color:#00000a;">This is done to check if Samba provides the AD DC default shares "netlogon" and "sysvol", that were created in "smb.conf" during provisioning.</div> <div style="color:#00000a;"><nowiki># /usr/local/samba/bin/smbclient -L localhost -U%</nowiki></div> [[Image:Image20.png]]== {{anchor|RefHeading2105957709649}} Open /etc/named.conf file. == <div style="color:#00000a;"><nowiki># vi /etc/named.conf</nowiki></div> [[Image:Image21.png]]== {{anchor|RefHeading2107957709649}} DNS keytab == <div style="color:#00000a;">This file was automatically created during provisioning/updating. Add the following' tkey-gssapi-keytab' option to the 'options' section of your named.conf, and set other values as shown in screen shot.</div> tkey-gssapi-keytab "/usr/local/samba/private/dns.keytab"; [[Image:Image22.png]]== {{anchor|RefHeading2109957709649}} Also make below entry in named.conf == <div style="color:#00000a;"></div> include "/usr/local/samba/private/named.conf"; [[Image:Image23.png]]== {{anchor|RefHeading2111957709649}} Change the owner ship as below and restart named services. == <div style="color:#00000a;"><nowiki># chown named.named /var/named/</nowiki></div> <div style="color:#00000a;"><nowiki># chgrp named /usr/local/samba/private/dns.keytab</nowiki></div> <div style="color:#00000a;"><nowiki># chmod g+r /usr/local/samba/private/dns.keytab</nowiki></div> <div style="color:#00000a;"><nowiki># systemctl enable named.service</nowiki></div> <div style="color:#00000a;"><nowiki># systemctl restart named.service</nowiki></div>== {{anchor|RefHeading2113957709649}} Copy Kerberos == <div style="color:#00000a;">file /usr/local/samba/private/krb5.conf to /etc/krb5.conf</div> <div style="color:#00000a;"><nowiki># cp /etc/krb5.conf /etc/krb5.conf.ori</nowiki></div> <div style="color:#00000a;"><nowiki># cp /usr/local/samba/private/krb5.conf /etc/krb5.conf</nowiki></div> [[Image:Image24.png]] <div style="color:#00000a;"></div>
Summary:
Please note that all contributions to TetraWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TetraWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Template:Anchor
(
edit
)