Jump to content

GSTN - Smaba PDC document: Difference between revisions

From TetraWiki
Created page with " <div style="color:#00000a;"></div> <div style="color:#00000a;"></div> <div style="color:#00000a;"></div> <div style="color:#00000a;"></div> <div style="color:#00000a;"><..."
 
Line 82: Line 82:




= {{anchor|RefHeading2063957709649}} Setup a Samba Active Directory Domain Controller =
= Setup a Samba Active Directory Domain Controller =


== {{anchor|RefHeading2065957709649}} Configure yum repository for Packages installation. ==
== Configure yum repository for Packages installation. ==


<div style="color:#00000a;">Edit /etc/yum.repos.d/local.repo </div>
<div style="color:#00000a;">Edit /etc/yum.repos.d/local.repo </div>
Line 115: Line 115:




== {{anchor|RefHeading2067957709649}} Assign the Ipv4 address and restart the network services. ==
== 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># 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>
Line 125: Line 125:




== {{anchor|RefHeading2069957709649}} Assign the Ipv6 address and restart the network services. And set hostname. ==
== 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># 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>
Line 133: Line 133:




[[Image:Image3.png]]== {{anchor|RefHeading2071957709649}} Edit /etc/hosts file and make below entries. ==
[[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;"><nowiki># vi /etc/hosts</nowiki></div>
Line 150: Line 150:




== {{anchor|RefHeading2073957709649}} Restart network service. ==
== Restart network service. ==


<div style="color:#00000a;"><nowiki># systemctl restart network.service</nowiki></div>
<div style="color:#00000a;"><nowiki># systemctl restart network.service</nowiki></div>
Line 158: Line 158:




== {{anchor|RefHeading2075957709649}} Reboot server. ==
== Reboot server. ==


<div style="color:#00000a;"><nowiki># init 6</nowiki></div>
<div style="color:#00000a;"><nowiki># init 6</nowiki></div>




[[Image:Image6.png]]== {{anchor|RefHeading2077957709649}} Install Dependencies for samba installation. ==
[[Image:Image6.png]]== Install Dependencies for samba installation. ==




Line 170: Line 170:




[[Image:Image7.png]]== {{anchor|RefHeading2079957709649}} Dependencies Installation is completed. ==
[[Image:Image7.png]]== Dependencies Installation is completed. ==




Line 177: Line 177:




<div style="color:#00000a;"></div>= {{anchor|RefHeading2081957709649}} Samba Installation =
<div style="color:#00000a;"></div>= Samba Installation =


== {{anchor|RefHeading2083957709649}} Download samba file from [https://www.samba.org/ https://www.samba.org/] and extract it. ==
== 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>
<div style="color:#00000a;"><nowiki># tar xvzf samba-4.4.4.tar.gz</nowiki></div>




[[Image:Image9.png]]== {{anchor|RefHeading2085957709649}} Enter in samba-4.4.4 directory and run configure command. ==
[[Image:Image9.png]]== Enter in samba-4.4.4 directory and run configure command. ==




Line 202: Line 202:




== {{anchor|RefHeading2087957709649}} Run make command. ==
== Run make command. ==


<div style="color:#00000a;"><nowiki># make</nowiki></div>
<div style="color:#00000a;"><nowiki># make</nowiki></div>
Line 214: Line 214:




[[Image:Image13.png]]== {{anchor|RefHeading2089957709649}} Run make install command. ==
[[Image:Image13.png]]== Run make install command. ==


<div style="color:#00000a;"><nowiki># make install</nowiki></div>
<div style="color:#00000a;"><nowiki># make install</nowiki></div>




[[Image:Image14.png]]== {{anchor|RefHeading2091957709649}} Provision a new domain: ==
[[Image:Image14.png]]== Provision a new domain: ==




Line 226: Line 226:




[[Image:Image15.png]]== {{anchor|RefHeading2093957709649}} Provisioning completed successfully. ==
[[Image:Image15.png]]== Provisioning completed successfully. ==






[[Image:Image16.png]]
[[Image:Image16.png]]


= {{anchor|RefHeading2095957709649}} Initialisation =
= {{anchor|RefHeading2095957709649}} Initialisation =

Revision as of 14:38, 30 January 2019


Samba AD

As is Build for Domain Controller installation

Date : 08.08.2016

Document Version : 1.0



Table of Contents1.Setup a Samba Active Directory Domain Controller

1.1.Configure yum repository for Packages installation.
1.2.Assign the Ipv4 address and restart the network services.
1.3.Assign the Ipv6 address and restart the network services. And set hostname.
1.4.Edit /etc/hosts file and make below entries.
1.5.Restart network service.
1.6.Reboot server.
1.7.Install Dependencies for samba installation.
1.8.Dependencies Installation is completed.

2.Samba Installation

2.1.Download samba file from https://www.samba.org/ and extract it.
2.2.Enter in samba-4.4.4 directory and run configure command.
2.3.Run make command.
2.4.Run make install command.
2.5.Provision a new domain:
2.6.Provisioning completed successfully.

3.Initialisation

3.1.Samba doesn't yet have init scripts included
3.2.Set the permissions on samba4 file.
3.3.Restart samba
3.4.Run "smbclient"
3.5.Open /etc/named.conf file.
3.6.DNS keytab
3.7.Also make below entry in named.conf
3.8.Change the owner ship as below and restart named services.
3.9.Copy Kerberos


Setup a Samba Active Directory Domain Controller

Configure yum repository for Packages installation.

Edit /etc/yum.repos.d/local.repo
# vi /etc/yum.repos.d/local.repo


Make below entries. Save file and exit.
[local]


name=local


baseurl=file:///mnt


gpgcheck=0


enabled=1




Assign the Ipv4 address and restart the network services.

# 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
# systemctl restart network.service



Assign the Ipv6 address and restart the network services. And set hostname.

# 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


# hostnamectl set-hostname gd9103.gstn.local


== Edit /etc/hosts file and make below entries. ==

# vi /etc/hosts
172.18.101.14gd9103.gstn.localgd9103


2404:a800:1000:d:7800::egd9103.gstn.localgd9103




Restart network service.

# systemctl restart network.service



Reboot server.

# init 6


== Install Dependencies for samba installation. ==


# 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


== Dependencies Installation is completed. ==



= Samba Installation =

Download samba file from https://www.samba.org/ and extract it.

# tar xvzf samba-4.4.4.tar.gz


== Enter in samba-4.4.4 directory and run configure command. ==


# cd samba-4.4.4/
# ./configure



Now configure done successfully.



Run make command.

# make


Make command finished successfully.



== Run make install command. ==

# make install


== Provision a new domain: ==


# /usr/local/samba/bin/samba-tool domain provision --use-rfc2307 --interactive


== Provisioning completed successfully. ==


Template:Anchor Initialisation

Template:Anchor Samba doesn't yet have init scripts included

  1. we can copy script from below link. https://wiki.samba.org/index.php/Samba4/InitScript
  2. create a file /etc/rc.d/init.d/samba4


# vi /etc/rc.d/init.d/samba4


and paste the below content in this file.
________________________________
#! /bin/bash
#
# samba4 Bring up/down samba4 service
#
# chkconfig: - 90 10
# description: Activates/Deactivates all samba4 interfaces configured to \
# start at boot time.
#
### BEGIN INIT INFO
# Provides:
# Should-Start:
# Short-Description: Bring up/down samba4
# Description: Bring up/down samba4
### END INIT INFO
# Source function library.
. /etc/init.d/functions
if [ -f /etc/sysconfig/samba4 ]; then
. /etc/sysconfig/samba4
fi
CWD=$(pwd)
prog="samba4"
start() {
# Attach irda device
echo -n $"Starting $prog: "
/usr/local/samba/sbin/samba
sleep 2
if ps ax | grep -v "grep" | grep -q /samba/sbin/samba ; then success $"samba4 startup"; else failure $"samba4 startup"; fi
echo
}
stop() {
# Stop service.
echo -n $"Shutting down $prog: "
killall samba
sleep 2
if ps ax | grep -v "grep" | grep -q /samba/sbin/samba ; then failure $"samba4 shutdown"; else success $"samba4 shutdown"; fi
echo
}
status() {
/usr/local/samba/sbin/samba --show-build
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status irattach
;;
restart|reload)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0
______________________________________________________________________________





















Template:Anchor Set the permissions on samba4 file.

# chmod 755 /etc/rc.d/init.d/samba4
# chmod +x /etc/rc.d/init.d/samba4
# ln -s /etc/rc.d/init.d/samba4 /etc/rc3.d/S80samba4
# chkconfig --add samba4
# chkconfig samba4 on


== Template:Anchor Restart samba ==

# service samba4 restart
or systemctl start samba4.service



Template:Anchor Run "smbclient"

This is done to check if Samba provides the AD DC default shares "netlogon" and "sysvol", that were created in "smb.conf" during provisioning.


# /usr/local/samba/bin/smbclient -L localhost -U%


== Template:Anchor Open /etc/named.conf file. ==


# vi /etc/named.conf


== Template:Anchor DNS keytab ==

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.


tkey-gssapi-keytab "/usr/local/samba/private/dns.keytab";



== Template:Anchor Also make below entry in named.conf ==

include "/usr/local/samba/private/named.conf";


File:Image23.png== Template:Anchor Change the owner ship as below and restart named services. ==

# chown named.named /var/named/
# chgrp named /usr/local/samba/private/dns.keytab
# chmod g+r /usr/local/samba/private/dns.keytab
# systemctl enable named.service
# systemctl restart named.service

== Template:Anchor Copy Kerberos ==

file /usr/local/samba/private/krb5.conf to /etc/krb5.conf
# cp /etc/krb5.conf /etc/krb5.conf.ori


# cp /usr/local/samba/private/krb5.conf /etc/krb5.conf