Jump to content

GSTN - Cups documentation: Difference between revisions

From TetraWiki
Praveen (talk | contribs)
No edit summary
Praveen (talk | contribs)
No edit summary
Line 3: Line 3:




<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


Samba AD
As is Build for Domain Controller installation
As is Build for Domain Controller installation
Date : 08.08.2016
Date : 08.08.2016
Document Version : 1.0
Document Version : 1.0




Table of Contents
1.Setup a Samba Active Directory Domain Controller 4
1.1.Configure yum repository for Packages installation. 4
1.2.Assign the Ipv4 address and restart the network services. 5
1.3.Assign the Ipv6 address and restart the network services. And set hostname. 6
1.4.Edit /etc/hosts file and make below entries. 7
1.5.Restart network service. 8
1.6.Reboot server. 9
1.7.Install Dependencies for samba installation. 9
1.8.Dependencies Installation is completed. 10
2.Samba Installation 11
2.1.Download samba file from https://www.samba.org/ and extract it. 11
2.2.Enter in samba-4.4.4 directory and run configure command. 11
2.3.Run make command. 13
2.4.Run make install command. 14
2.5.Provision a new domain: 14
2.6.Provisioning completed successfully. 15
3.Initialisation 16
3.1.Samba doesn't yet have init scripts included 16
3.2.Set the permissions on samba4 file. 19
3.3.Restart samba 19
3.4.Run "smbclient" 20
3.5.Open /etc/named.conf file. 21
3.6.DNS keytab 22
3.7.Also make below entry in named.conf 22
3.8.Change the owner ship as below and restart named services. 23
3.9.Copy Kerberos 23


1. Setup a Samba Active Directory Domain Controller
1.1. Configure yum repository for Packages installation.
Edit /etc/yum.repos.d/local.repo
# vi /etc/yum.repos.d/local.repo


Table of Contents[[#RefHeading2063957709649|1.Setup a Samba Active Directory Domain Controller4]]
:[[#RefHeading2065957709649|1.1.Configure yum repository for Packages installation.4]]
:[[#RefHeading2067957709649|1.2.Assign the Ipv4 address and restart the network services.5]]
:[[#RefHeading2069957709649|1.3.Assign the Ipv6 address and restart the network services. And set hostname.6]]
:[[#RefHeading2071957709649|1.4.Edit /etc/hosts file and make below entries.7]]
:[[#RefHeading2073957709649|1.5.Restart network service.8]]
:[[#RefHeading2075957709649|1.6.Reboot server.9]]
:[[#RefHeading2077957709649|1.7.Install Dependencies for samba installation.9]]
:[[#RefHeading2079957709649|1.8.Dependencies Installation is completed.10]]
[[#RefHeading2081957709649|2.Samba Installation11]]
:[[#RefHeading2083957709649|2.1.Download samba file from https://www.samba.org/ and extract it.11]]
:[[#RefHeading2085957709649|2.2.Enter in samba-4.4.4 directory and run configure command.11]]
:[[#RefHeading2087957709649|2.3.Run make command.13]]
:[[#RefHeading2089957709649|2.4.Run make install command.14]]
:[[#RefHeading2091957709649|2.5.Provision a new domain:14]]
:[[#RefHeading2093957709649|2.6.Provisioning completed successfully.15]]
[[#RefHeading2095957709649|3.Initialisation16]]
:[[#RefHeading2097957709649|3.1.Samba doesn't yet have init scripts included16]]
:[[#RefHeading2099957709649|3.2.Set the permissions on samba4 file.19]]
:[[#RefHeading2101957709649|3.3.Restart samba19]]
:[[#RefHeading2103957709649|3.4.Run "smbclient"20]]
:[[#RefHeading2105957709649|3.5.Open /etc/named.conf file.21]]
:[[#RefHeading2107957709649|3.6.DNS keytab22]]
:[[#RefHeading2109957709649|3.7.Also make below entry in named.conf22]]
:[[#RefHeading2111957709649|3.8.Change the owner ship as below and restart named services.23]]
:[[#RefHeading2113957709649|3.9.Copy Kerberos23]]<div style="color:#00000a;"></div>
= {{anchor|RefHeading2063957709649}} Setup a Samba Active Directory Domain Controller =
== {{anchor|RefHeading2065957709649}} 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:]]
<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:]]
== {{anchor|RefHeading2067957709649}} 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:]]
== {{anchor|RefHeading2069957709649}} 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:]]== {{anchor|RefHeading2071957709649}} 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:]]
== {{anchor|RefHeading2073957709649}} Restart network service. ==
<div style="color:#00000a;"><nowiki># systemctl restart network.service</nowiki></div>
[[Image:]]
== {{anchor|RefHeading2075957709649}} Reboot server. ==
<div style="color:#00000a;"><nowiki># init 6</nowiki></div>
[[Image:]]== {{anchor|RefHeading2077957709649}} 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:]]== {{anchor|RefHeading2079957709649}} Dependencies Installation is completed. ==
[[Image:]]
<div style="color:#00000a;"></div>= {{anchor|RefHeading2081957709649}} Samba Installation =
== {{anchor|RefHeading2083957709649}} 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:]]== {{anchor|RefHeading2085957709649}} 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:]]
<div style="color:#00000a;">Now configure done successfully.</div>
[[Image:]]
== {{anchor|RefHeading2087957709649}} Run make command. ==
<div style="color:#00000a;"><nowiki># make</nowiki></div>
[[Image:]]
<div style="color:#00000a;">Make command finished successfully.</div>
[[Image:]]== {{anchor|RefHeading2089957709649}} Run make install command. ==
<div style="color:#00000a;"><nowiki># make install</nowiki></div>
[[Image:]]== {{anchor|RefHeading2091957709649}} Provision a new domain: ==
<div style="color:#00000a;"><nowiki># /usr/local/samba/bin/samba-tool domain provision --use-rfc2307 --interactive</nowiki></div>
[[Image:]]== {{anchor|RefHeading2093957709649}} Provisioning completed successfully. ==
[[Image:]]
= {{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>


Make below entries. Save file and exit.
<div style="color:#00000a;"><nowiki>#</nowiki></div>
[local]


name=local
<div style="color:#00000a;"><nowiki>### BEGIN INIT INFO</nowiki></div>


baseurl=file:///mnt
<div style="color:#00000a;"><nowiki># Provides:</nowiki></div>


gpgcheck=0
<div style="color:#00000a;"><nowiki># Should-Start:</nowiki></div>


enabled=1
<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>


1.2. Assign the Ipv4 address and restart the network services.
<div style="color:#00000a;">. /etc/init.d/functions</div>
# 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


<div style="color:#00000a;">if [ -f /etc/sysconfig/samba4 ]; then</div>


<div style="color:#00000a;">. /etc/sysconfig/samba4</div>


1.3. Assign the Ipv6 address and restart the network services. And set hostname.
<div style="color:#00000a;">fi</div>
# 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
<div style="color:#00000a;">CWD=$(pwd)</div>


<div style="color:#00000a;">prog="samba4"</div>


1.4. Edit /etc/hosts file and make below entries.
<div style="color:#00000a;">start() {</div>
# vi /etc/hosts
172.18.101.14 gd9103.gstn.local gd9103


<div style="color:#00000a;"><nowiki># Attach irda device</nowiki></div>


2404:a800:1000:d:7800::e gd9103.gstn.local gd9103
<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>


1.5. Restart network service.
<div style="color:#00000a;">echo</div>
# systemctl restart network.service


<div style="color:#00000a;">}</div>


<div style="color:#00000a;">stop() {</div>


1.6. Reboot server.
<div style="color:#00000a;"><nowiki># Stop service.</nowiki></div>
# init 6


<div style="color:#00000a;">echo -n $"Shutting down $prog: "</div>


1.7. Install Dependencies for samba installation.
<div style="color:#00000a;">killall samba</div>


# 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
<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>


1.8. Dependencies Installation is completed.
<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>


2. Samba Installation
<div style="color:#00000a;">}</div>
2.1. Download samba file from https://www.samba.org/ and extract it.
# tar xvzf samba-4.4.4.tar.gz


<div style="color:#00000a;"><nowiki># See how we were called.</nowiki></div>


2.2. Enter in samba-4.4.4 directory and run configure command.
<div style="color:#00000a;">case "$1" in</div>


# cd samba-4.4.4/
<div style="color:#00000a;">start)</div>
# ./configure


<div style="color:#00000a;">start</div>


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


Now configure done successfully.
<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>


2.3. Run make command.
<div style="color:#00000a;">status irattach</div>
# make


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


Make command finished successfully.
<div style="color:#00000a;">restart|reload)</div>


<div style="color:#00000a;">stop</div>


<div style="color:#00000a;">start</div>


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


<div style="color:#00000a;"><nowiki>*)</nowiki></div>


2.5. Provision a new domain:
<div style="color:#00000a;">echo $"Usage: $0 {start|stop|restart|status}"</div>


# /usr/local/samba/bin/samba-tool domain provision --use-rfc2307 --interactive
<div style="color:#00000a;">exit 1</div>


<div style="color:#00000a;">esac</div>


2.6. Provisioning completed successfully.
<div style="color:#00000a;">exit 0</div>


<div style="color:#00000a;">______________________________________________________________________________</div>




3. Initialisation
[[Image:]]
3.1. 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
______________________________________________________________________________




Line 238: Line 399:




3.2. 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




3.3. Restart samba
# service samba4 restart
  or  systemctl start samba4.service






3.4. 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%




3.5. Open /etc/named.conf file.


# vi /etc/named.conf




3.6. 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.
 
 
== {{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:]]== {{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:]]
 
 
== {{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:]]== {{anchor|RefHeading2105957709649}} Open /etc/named.conf file. ==
 
 
 
<div style="color:#00000a;"><nowiki># vi /etc/named.conf</nowiki></div>
 
 
[[Image:]]== {{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";
tkey-gssapi-keytab "/usr/local/samba/private/dns.keytab";
Line 270: Line 460:




3.7. Also make below entry in named.conf
 
[[Image:]]== {{anchor|RefHeading2109957709649}} Also make below entry in named.conf ==
 
<div style="color:#00000a;"></div>


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




3.8. Change the owner ship as below and restart named services.
[[Image:]]== {{anchor|RefHeading2111957709649}} Change the owner ship as below and restart named services. ==
# chown named.named /var/named/
 
# chgrp named /usr/local/samba/private/dns.keytab
<div style="color:#00000a;"><nowiki># chown named.named /var/named/</nowiki></div>
# chmod g+r /usr/local/samba/private/dns.keytab
 
# systemctl enable named.service
<div style="color:#00000a;"><nowiki># chgrp named /usr/local/samba/private/dns.keytab</nowiki></div>
# systemctl restart named.service
 
3.9. Copy Kerberos
<div style="color:#00000a;"><nowiki># chmod g+r /usr/local/samba/private/dns.keytab</nowiki></div>
file /usr/local/samba/private/krb5.conf to /etc/krb5.conf
 
# cp /etc/krb5.conf /etc/krb5.conf.ori
<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:]]
 


# cp /usr/local/samba/private/krb5.conf /etc/krb5.conf
<div style="color:#00000a;"></div>

Revision as of 04:11, 1 February 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 Controller4

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

2.Samba Installation11

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

3.Initialisation16

3.1.Samba doesn't yet have init scripts included16
3.2.Set the permissions on samba4 file.19
3.3.Restart samba19
3.4.Run "smbclient"20
3.5.Open /etc/named.conf file.21
3.6.DNS keytab22
3.7.Also make below entry in named.conf22
3.8.Change the owner ship as below and restart named services.23
3.9.Copy Kerberos23

Template:Anchor Setup a Samba Active Directory Domain Controller

Template:Anchor Configure yum repository for Packages installation.

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


[[Image:]]

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


name=local


baseurl=file:///mnt


gpgcheck=0


enabled=1



[[Image:]]


Template:Anchor 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


[[Image:]]


Template:Anchor 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


[[Image:]]== Template:Anchor 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



[[Image:]]


Template:Anchor Restart network service.

# systemctl restart network.service


[[Image:]]


Template:Anchor Reboot server.

# init 6


[[Image:]]== Template:Anchor 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


[[Image:]]== Template:Anchor Dependencies Installation is completed. ==


[[Image:]]


= Template:Anchor Samba Installation =

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

# tar xvzf samba-4.4.4.tar.gz


[[Image:]]== Template:Anchor Enter in samba-4.4.4 directory and run configure command. ==


# cd samba-4.4.4/
# ./configure


[[Image:]]


Now configure done successfully.


[[Image:]]


Template:Anchor Run make command.

# make


[[Image:]]

Make command finished successfully.



[[Image:]]== Template:Anchor Run make install command. ==

# make install


[[Image:]]== Template:Anchor Provision a new domain: ==


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


[[Image:]]== Template:Anchor Provisioning completed successfully. ==


[[Image:]]


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
______________________________________________________________________________


[[Image:]]




















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


[[Image:]]== Template:Anchor Restart samba ==

# service samba4 restart
or systemctl start samba4.service


[[Image:]]


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%


[[Image:]]== Template:Anchor Open /etc/named.conf file. ==


# vi /etc/named.conf


[[Image:]]== 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";



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

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


[[Image:]]== 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
















[[Image:]]