<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki-stadm.eri.ucsb.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stadm1</id>
	<title>Stadm - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki-stadm.eri.ucsb.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stadm1"/>
	<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/Special:Contributions/Stadm1"/>
	<updated>2026-04-04T00:48:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2944</id>
		<title>AD Topology</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2944"/>
		<updated>2016-04-19T20:22:20Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Topology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Topology=&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
===Servers===&lt;br /&gt;
*Rumba(CentOS 7)&lt;br /&gt;
**AD Controller&lt;br /&gt;
**Group Policy Objects(GPO) must be edited on Rumba(through Group Policy Management on a  domain joined Windows computer)&lt;br /&gt;
***This is because GPO syncing is done through rsync and Limbo pulls the GPO changes from Rumba&lt;br /&gt;
***Running a DNS forwarder, DNS can be viewed using RSAT, nothing really ever needs to be changed there&lt;br /&gt;
**NFS mounts here&lt;br /&gt;
**smb.conf location: /usr/local/samba/etc/smb.conf &lt;br /&gt;
*Limbo(Centos 6)&lt;br /&gt;
**AD Controller(in case rumba goes down users can still authenticate, NFS mount points are on rumba though so anyone with a roaming profile will have issues loading and saving profile)&lt;br /&gt;
**Also running DNS forwarder that syncs w/ rumba&lt;br /&gt;
*Managing rumba and limbo: http://wiki.eri.ucsb.edu/stadm/Samba4_Administration&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
===Servers===&lt;br /&gt;
*Daft(Windows Server)&lt;br /&gt;
**Windows Server Update Services(WSUS) - provides domain joined computers update management if GPO is applied&lt;br /&gt;
***http://wiki.eri.ucsb.edu/stadm/Samba4_Administration#WSUS&lt;br /&gt;
**Can be used to manage Domain(GPO's and Users/Computers): http://wiki.eri.ucsb.edu/stadm/Samba4_Administration#Creating_Users &lt;br /&gt;
***RSAT can as well from any domain joined machine: https://wiki.samba.org/index.php/Installing_RSAT&lt;br /&gt;
*atlas/quinaya/tliyel-Remote Desktop Servers that need a DC to provide Windows RDS&lt;br /&gt;
===Computers===&lt;br /&gt;
*lluvia/smaug-Windows 7 Machines with RSAT installed, can manage the domain. Can be used to test GPO's or user creation on the domain.&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2943</id>
		<title>AD Topology</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2943"/>
		<updated>2016-04-19T20:19:54Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Topology=&lt;br /&gt;
&lt;br /&gt;
==Servers==&lt;br /&gt;
===Linux===&lt;br /&gt;
*Rumba(CentOS 7)&lt;br /&gt;
**AD Controller&lt;br /&gt;
**Group Policy Objects(GPO) must be edited on Rumba(through Group Policy Management on a  domain joined Windows computer)&lt;br /&gt;
***This is because GPO syncing is done through rsync and Limbo pulls the GPO changes from Rumba&lt;br /&gt;
***Running a DNS forwarder, DNS can be viewed using RSAT, nothing really ever needs to be changed there&lt;br /&gt;
**NFS mounts here&lt;br /&gt;
**smb.conf location: /usr/local/samba/etc/smb.conf &lt;br /&gt;
*Limbo(Centos 6)&lt;br /&gt;
**AD Controller(in case rumba goes down users can still authenticate, NFS mount points are on rumba though so anyone with a roaming profile will have issues loading and saving profile)&lt;br /&gt;
**Also running DNS forwarder that syncs w/ rumba&lt;br /&gt;
*Managing rumba and limbo: http://wiki.eri.ucsb.edu/stadm/Samba4_Administration&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
*Daft(Windows Server)&lt;br /&gt;
**Windows Server Update Services(WSUS) - provides domain joined computers update management if GPO is applied&lt;br /&gt;
***http://wiki.eri.ucsb.edu/stadm/Samba4_Administration#WSUS&lt;br /&gt;
**Can be used to manage Domain(GPO's and Users/Computers): http://wiki.eri.ucsb.edu/stadm/Samba4_Administration#Creating_Users &lt;br /&gt;
***RSAT can as well from any domain joined machine: https://wiki.samba.org/index.php/Installing_RSAT&lt;br /&gt;
*atlas/quinaya/tliyel-Remote Desktop Servers that need a DC to provide Windows RDS&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2942</id>
		<title>AD Topology</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2942"/>
		<updated>2016-04-19T20:11:13Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Topology=&lt;br /&gt;
&lt;br /&gt;
==Servers==&lt;br /&gt;
===Linux===&lt;br /&gt;
*Rumba(CentOS 7)&lt;br /&gt;
**AD Controller&lt;br /&gt;
**Group Policy Objects(GPO) must be edited on Rumba(through Group Policy Management on a  domain joined Windows computer)&lt;br /&gt;
***This is because GPO syncing is done through rsync and Limbo pulls the GPO changes from Rumba&lt;br /&gt;
***Running a DNS forwarder, DNS can be viewed using RSAT, nothing really ever needs to be changed there&lt;br /&gt;
**NFS mounts here&lt;br /&gt;
**smb.conf location: /usr/local/samba/etc/smb.conf &lt;br /&gt;
*Limbo(Centos 6)&lt;br /&gt;
**AD Controller(in case rumba goes down users can still authenticate, NFS mount points are on rumba though so anyone with a roaming profile will have issues loading and saving profile)&lt;br /&gt;
**Also running DNS forwarder that syncs w/ rumba&lt;br /&gt;
*Managing rumba and limbo: http://wiki.eri.ucsb.edu/stadm/Samba4_Administration&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
*Daft(Windows Server)&lt;br /&gt;
**Windows Server Update Services(WSUS) - provides domain joined computers update management if GPO is applied&lt;br /&gt;
***http://wiki.eri.ucsb.edu/stadm/Samba4_Administration#WSUS&lt;br /&gt;
**Can be used to manage Domain(GPO's and Users/Computers)&lt;br /&gt;
***RSAT can as well from any domain joined machine: https://wiki.samba.org/index.php/Installing_RSAT&lt;br /&gt;
*atlas/quinaya/tliyel-Remote Desktop Servers that need a DC to provide Windows RDS&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2941</id>
		<title>AD Topology</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2941"/>
		<updated>2016-04-19T20:04:38Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Servers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Topology=&lt;br /&gt;
&lt;br /&gt;
==Servers==&lt;br /&gt;
===Linux===&lt;br /&gt;
*Rumba(CentOS 7)&lt;br /&gt;
**AD Controller&lt;br /&gt;
**Group Policy Objects(GPO) must be edited on Rumba(through Group Policy Management on a  domain joined Windows computer)&lt;br /&gt;
***This is because GPO syncing is done through rsync and Limbo pulls the GPO changes from Rumba&lt;br /&gt;
***Running a DNS forwarder, DNS can be viewed using RSAT, nothing really ever needs to be changed there&lt;br /&gt;
*Limbo(Centos 6)&lt;br /&gt;
**AD Controller(in case rumba goes down users can still authenticate, NFS mount points are on rumba though so anyone with a roaming profile will have issues loading and saving profile)&lt;br /&gt;
**Also running DNS forwarder that syncs w/ rumba&lt;br /&gt;
*Managing rumba and limbo: http://wiki.eri.ucsb.edu/stadm/Samba4_Administration&lt;br /&gt;
===Windows===&lt;br /&gt;
*Daft(Windows Server)&lt;br /&gt;
**Windows Server Update Services(WSUS) - provides domain joined computers update management if GPO is applied&lt;br /&gt;
***http://wiki.eri.ucsb.edu/stadm/Samba4_Administration#WSUS&lt;br /&gt;
**Can be used to manage Domain(GPO's and Users/Computers)&lt;br /&gt;
***RSAT can as well from any domain joined machine: https://wiki.samba.org/index.php/Installing_RSAT&lt;br /&gt;
*atlas/quinaya/tliyel-Remote Desktop Servers that need a DC to provide Windows RDS&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2940</id>
		<title>AD Topology</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2940"/>
		<updated>2016-04-19T19:57:49Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Servers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Topology=&lt;br /&gt;
&lt;br /&gt;
==Servers==&lt;br /&gt;
===Linux===&lt;br /&gt;
*Rumba(CentOS 7)&lt;br /&gt;
**AD Controller&lt;br /&gt;
**Group Policy Objects(GPO) must be edited on Rumba(through Group Policy Management on a  domain joined Windows computer)&lt;br /&gt;
***This is because GPO syncing is done through rsync and Limbo pulls the GPO changes from Rumba&lt;br /&gt;
***Running a DNS forwarder, DNS can be viewed using RSAT, nothing really ever needs to be changed there&lt;br /&gt;
*Limbo(Centos 6)&lt;br /&gt;
**AD Controller(in case rumba goes down users can still authenticate, NFS mount points are on rumba though so anyone with a roaming profile will have issues loading and saving profile)&lt;br /&gt;
**Also running DNS forwarder that syncs w/ rumba&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
*Daft(Windows Server)&lt;br /&gt;
**Windows Server Update Services(WSUS) - provides domain joined computers update management if GPO is applied&lt;br /&gt;
***http://wiki.eri.ucsb.edu/stadm/Samba4_Administration#WSUS&lt;br /&gt;
**Can be used to manage Domain(GPO's and Users/Computers)&lt;br /&gt;
***RSAT can as well from any domain joined machine: https://wiki.samba.org/index.php/Installing_RSAT&lt;br /&gt;
*atlas/quinaya/tliyel-Remote Desktop Servers that need a DC to provide Windows RDS&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2939</id>
		<title>AD Topology</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2939"/>
		<updated>2016-04-19T19:57:01Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Topology=&lt;br /&gt;
&lt;br /&gt;
==Servers==&lt;br /&gt;
===Linux===&lt;br /&gt;
*Rumba(CentOS 7)&lt;br /&gt;
**AD Controller&lt;br /&gt;
**Group Policy Objects(GPO) must be edited on Rumba(through Group Policy Management on a  domain joined Windows computer)&lt;br /&gt;
***This is because GPO syncing is done through rsync and Limbo pulls the GPO changes from Rumba&lt;br /&gt;
***Running a DNS forwarder, DNS can be viewed using RSAT&lt;br /&gt;
*Limbo(Centos 6)&lt;br /&gt;
**AD Controller(in case rumba goes down users can still authenticate, NFS mount points are on rumba though so anyone with a roaming profile will have issues loading and saving profile)&lt;br /&gt;
**Also running DNS forwarder that syncs w/ rumba&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
*Daft(Windows Server)&lt;br /&gt;
**Windows Server Update Services(WSUS) - provides domain joined computers update management if GPO is applied&lt;br /&gt;
***http://wiki.eri.ucsb.edu/stadm/Samba4_Administration#WSUS&lt;br /&gt;
**Can be used to manage Domain(GPO's and Users/Computers)&lt;br /&gt;
***RSAT can as well from any domain joined machine: https://wiki.samba.org/index.php/Installing_RSAT&lt;br /&gt;
*atlas/quinaya/tliyel-Remote Desktop Servers that need a DC to provide Windows RDS&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2938</id>
		<title>AD Topology</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2938"/>
		<updated>2016-04-19T19:55:04Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Topology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Topology=&lt;br /&gt;
&lt;br /&gt;
==Servers==&lt;br /&gt;
===Linux===&lt;br /&gt;
*Rumba(CentOS 7)&lt;br /&gt;
**AD Controller&lt;br /&gt;
**Group Policy Objects(GPO) must be edited on Rumba(through Group Policy Management on a  domain joined Windows computer)&lt;br /&gt;
***This is because GPO syncing is done through rsync and Limbo pulls the GPO changes from Rumba&lt;br /&gt;
*Limbo(Centos 6)&lt;br /&gt;
**AD Controller(in case rumba goes down users can still authenticate, NFS mount points are on rumba though so anyone with a roaming profile will have issues loading and saving profile)&lt;br /&gt;
===Windows===&lt;br /&gt;
*Daft(Windows Server)&lt;br /&gt;
**Windows Server Update Services(WSUS) - provides domain joined computers update management if GPO is applied&lt;br /&gt;
***http://wiki.eri.ucsb.edu/stadm/Samba4_Administration#WSUS&lt;br /&gt;
**Can be used to manage Domain(GPO's and Users/Computers)&lt;br /&gt;
***RSAT can as well from any domain joined machine: https://wiki.samba.org/index.php/Installing_RSAT&lt;br /&gt;
*atlas/quinaya/tliyel-Remote Desktop Servers that need a DC to provide Windows RDS&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2937</id>
		<title>AD Topology</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2937"/>
		<updated>2016-04-19T19:54:50Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Topology=&lt;br /&gt;
&lt;br /&gt;
==Servers==&lt;br /&gt;
===Linux==&lt;br /&gt;
*Rumba(CentOS 7)&lt;br /&gt;
**AD Controller&lt;br /&gt;
**Group Policy Objects(GPO) must be edited on Rumba(through Group Policy Management on a  domain joined Windows computer)&lt;br /&gt;
***This is because GPO syncing is done through rsync and Limbo pulls the GPO changes from Rumba&lt;br /&gt;
*Limbo(Centos 6)&lt;br /&gt;
**AD Controller(in case rumba goes down users can still authenticate, NFS mount points are on rumba though so anyone with a roaming profile will have issues loading and saving profile)&lt;br /&gt;
===Windows===&lt;br /&gt;
*Daft(Windows Server)&lt;br /&gt;
**Windows Server Update Services(WSUS) - provides domain joined computers update management if GPO is applied&lt;br /&gt;
***http://wiki.eri.ucsb.edu/stadm/Samba4_Administration#WSUS&lt;br /&gt;
**Can be used to manage Domain(GPO's and Users/Computers)&lt;br /&gt;
***RSAT can as well from any domain joined machine: https://wiki.samba.org/index.php/Installing_RSAT&lt;br /&gt;
*atlas/quinaya/tliyel-Remote Desktop Servers that need a DC to provide Windows RDS&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2936</id>
		<title>AD Topology</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2936"/>
		<updated>2016-04-19T19:52:39Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Topology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Topology=&lt;br /&gt;
&lt;br /&gt;
==Servers==&lt;br /&gt;
===Linux==&lt;br /&gt;
*Rumba(CentOS 7)&lt;br /&gt;
**AD Controller&lt;br /&gt;
**Group Policy Objects(GPO) must be edited on Rumba(through Group Policy Management on a  domain joined Windows computer)&lt;br /&gt;
***This is because GPO syncing is done through rsync and Limbo pulls the GPO changes from Rumba&lt;br /&gt;
*Limbo(Centos 6)&lt;br /&gt;
**AD Controller(in case rumba goes down users can still authenticate, NFS mount points are on rumba though so anyone with a roaming profile will have issues loading and saving profile)&lt;br /&gt;
===Windows===&lt;br /&gt;
*Daft(Windows Server)&lt;br /&gt;
**Windows Server Update Services(WSUS) - provides domain joined computers update management if GPO is applied&lt;br /&gt;
**Can be used to manage Domain(GPO's and Users/Computers)&lt;br /&gt;
***RSAT can as well from any domain joined machine: https://wiki.samba.org/index.php/Installing_RSAT&lt;br /&gt;
*atlas/quinaya/tliyel-Remote Desktop Servers that need a DC to provide Windows RDS&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4_Centos_7&amp;diff=2935</id>
		<title>AD Samba4 Centos 7</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4_Centos_7&amp;diff=2935"/>
		<updated>2016-04-19T19:46:52Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Purpose */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.16&lt;br /&gt;
&lt;br /&gt;
This page serves to show how to Setup Samba 4 on a Centos 7 machine and migrate over from Centos 6.&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 7&lt;br /&gt;
&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
*Install a minimal version of Centos 7 on a VM or dev box&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
*Here is a minimal list of packages needed to compile Samba 4 with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 libxslt docbook-style-xsl openldap-devel pam-devel bzip2&lt;br /&gt;
&lt;br /&gt;
*Here are optional packages that are used in this guide&lt;br /&gt;
 yum install vim wget&lt;br /&gt;
&lt;br /&gt;
==Restoring==&lt;br /&gt;
*we are coming from a working environment running on centos 6, we are going to restore our databases to /usr/local/samba and then compile and install Samba 4 over them&lt;br /&gt;
*I have tried installing samba first and then restoring form backup however samba was having issues with wind the Winbind.so binary, a recompile and install fixed that issue, however by restoring first we avoid having to reinstall samba after restore&lt;br /&gt;
*These folders probably wont be there if you havent installed samba before, check to see before running command&lt;br /&gt;
 rm -rf /usr/local/samba/etc&lt;br /&gt;
 rm -rf /usr/local/samba/private&lt;br /&gt;
 rm -rf /usr/local/samba/var/locks/sysvol&lt;br /&gt;
*If /usr/local/samba does not exist(because samba has never been installed before) make the /usr/local/samba directory&lt;br /&gt;
 mkdir /usr/local/samba&lt;br /&gt;
*change directories to where you have your backups and do a restore&lt;br /&gt;
 cd /usr/local/backups&lt;br /&gt;
 tar -jxf etc.{Timestamp}.tar.bz2 -C /usr/local/samba/&lt;br /&gt;
 tar -jxf samba4_private.{Timestamp}.tar.bz2 -C /usr/local/samba/&lt;br /&gt;
 tar -jxf sysvol.{Timestamp}.tar.bz2 -C /usr/local/samba/&lt;br /&gt;
&lt;br /&gt;
 find /usr/local/samba/private/ -type f -name '*.ldb.bak' -print0 | while read -d $'\0' f ; do mv &amp;quot;$f&amp;quot; &amp;quot;${f%.bak}&amp;quot; ; done&lt;br /&gt;
*Our profiles are stored on an NFS server, copy over the auto.home file where our profiles are stored&lt;br /&gt;
 scp root@AD1.DOMAIN.EDU:/etc/auto.home /etc/&lt;br /&gt;
*restart autofs&lt;br /&gt;
 systemctl restart autofs&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 02-18-15):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.16.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.16.tar.gz&lt;br /&gt;
 cd ~/samba-4.1.16&lt;br /&gt;
 ./configure --enable-debug --enable-selftest --with-ads --with-systemd --with-winbind&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
*libgnutls needs to be linked like so(upgrade specific install):&lt;br /&gt;
 ln -s /usr/lib64/libgnutls.so.28 /usr/lib64/libgnutls.so.26&lt;br /&gt;
*The kerberos file needs to be configured properly&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
&lt;br /&gt;
 dns_lookup_realm = false&lt;br /&gt;
 dns_lookup_kdc = true&lt;br /&gt;
 default_realm = DOMAIN.EDU&lt;br /&gt;
*add samba directory to bashrc file&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
*disable selinux for now&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*change enforcing=enabled to &lt;br /&gt;
 enforcing=disabled&lt;br /&gt;
*reboot the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Adding Samba to Systemd==&lt;br /&gt;
*create a samba.service file at /etc/systemd/system/samba.service&lt;br /&gt;
 vim /etc/systemd/system/samba.service&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description= Samba 4 Active Directory&lt;br /&gt;
 After=syslog.target&lt;br /&gt;
 After=network.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=forking&lt;br /&gt;
 PIDFile=/usr/local/samba/var/run/samba.pid&lt;br /&gt;
 ExecStart=/usr/local/samba/sbin/samba&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
==Adding winbind to nsswitch.conf==&lt;br /&gt;
*add winbind to /etc/nsswitch.conf&lt;br /&gt;
 vim /etc/nsswitch.conf&lt;br /&gt;
&lt;br /&gt;
 passwd:     files winbind sss&lt;br /&gt;
 shadow:     files sss&lt;br /&gt;
 group:      files winbind sss&lt;br /&gt;
*link winbind so that nssswitch can find and enumerate domain &lt;br /&gt;
 ln -s  /usr/local/samba/lib/libnss_winbind.so.2  /lib64/libnss_winbind.so&lt;br /&gt;
 ln  -s /lib64/libnss_winbind.so  /lib64/libnss_winbind.so.2&lt;br /&gt;
&lt;br /&gt;
==Adding Backup Script==&lt;br /&gt;
 cp ~/samba-4.1.16/source4/scripting/bin/samba_backup /usr/local/samba/sbin&lt;br /&gt;
 chown root:root /usr/local/samba/sbin/samba_backup&lt;br /&gt;
 chmod 750 /usr/local/samba/sbin/samba_backup&lt;br /&gt;
*make backup directory&lt;br /&gt;
 mkdir /usr/local/backups&lt;br /&gt;
*You can now run the samba backup script&lt;br /&gt;
 samba_backup&lt;br /&gt;
*or just add it to cron for weekly backups&lt;br /&gt;
 crontab -e&lt;br /&gt;
*insert the following&lt;br /&gt;
 #Run a weekly backup on Rumba for samba4 Active Directory&lt;br /&gt;
 0 3 * * 0 /usr/local/samba/bin/samba_backup &amp;gt;&amp;gt; /root/backup_logs/samba_bak.log 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
==Start/Stop Samba service==&lt;br /&gt;
*start the Samba service&lt;br /&gt;
 systemctl start samba&lt;br /&gt;
*enable the samba service on startup&lt;br /&gt;
 systemctl enable samba&lt;br /&gt;
*check the status of samba&lt;br /&gt;
 systemctl status samba&lt;br /&gt;
*If you need to stop the samba service use&lt;br /&gt;
 systemctl stop samba&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
*We prefer iptables so we are turning off firewalld and enabling iptables instead&lt;br /&gt;
 systemctl stop firewalld     # stop firewalld temporarily&lt;br /&gt;
 systemctl mask firewalld    # not sure what mask does, but I assume its similar to disable&lt;br /&gt;
 yum install iptables-services  # install iptables-services package&lt;br /&gt;
 systemctl enable iptables    # Enable the service at boot-time&lt;br /&gt;
*add in your rules into /ets/sysconfig/iptables (do this while iptables is off)&lt;br /&gt;
 systemctl start iptables     # start iptables&lt;br /&gt;
*the following will save the rules located at /etc/sysconfig/iptables&lt;br /&gt;
 service iptables save   # save iptables rules in /etc/sysconfig/iptables, overwriting current set&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2934</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2934"/>
		<updated>2016-04-19T19:46:25Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Purpose */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
Samba Ports needed here:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_port_usage&lt;br /&gt;
*settings(old?):&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few minutes apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
*Samba wiki's:&lt;br /&gt;
**https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
**https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/domain&lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/domain&lt;br /&gt;
 read only = No&lt;br /&gt;
 hide files = /desktop.ini/$RECYCLE.BIN/&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
Follow:&lt;br /&gt;
*https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
*https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From windows command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO/WSUS==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2926</id>
		<title>AD Topology</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2926"/>
		<updated>2016-04-12T19:24:07Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Topology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Topology=&lt;br /&gt;
&lt;br /&gt;
==Servers==&lt;br /&gt;
*Rumba(CentOS 7)&lt;br /&gt;
**AD Controller&lt;br /&gt;
**Group Policy Objects(GPO) must be edited on Rumba(through Group Policy Management on a  domain joined Windows computer)&lt;br /&gt;
***This is because GPO syncing is done through rsync and Limbo pulls the GPO changes from Rumba&lt;br /&gt;
*Limbo(Centos 6)&lt;br /&gt;
**AD Controller(in case rumba goes down users can still authenticate, NFS mount points are on rumba though so anyone with a roaming profile will have issues loading and saving profile)&lt;br /&gt;
&lt;br /&gt;
*Daft(Windows Server)&lt;br /&gt;
**Windows Server Update Services(WSUS) - provides domain joined computers update management if GPO is applied&lt;br /&gt;
**Can be used to manage Domain(GPO's and Users/Computers)&lt;br /&gt;
***RSAT can as well from any domain joined machine: https://wiki.samba.org/index.php/Installing_RSAT&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2925</id>
		<title>AD Topology</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Topology&amp;diff=2925"/>
		<updated>2016-04-12T19:16:44Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: Created page with &amp;quot;Category:Projects Category:Samba Category:Samba4AD   =Topology=  ==Servers== *Rumba(CentOS 7) **Services:  AD Controller  *Limbo(Centos 6) **Services:  AD Controll...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Topology=&lt;br /&gt;
&lt;br /&gt;
==Servers==&lt;br /&gt;
*Rumba(CentOS 7)&lt;br /&gt;
**Services:&lt;br /&gt;
 AD Controller&lt;br /&gt;
&lt;br /&gt;
*Limbo(Centos 6)&lt;br /&gt;
**Services:&lt;br /&gt;
 AD Controller&lt;br /&gt;
&lt;br /&gt;
*Daft(Windows Server)&lt;br /&gt;
**Services:&lt;br /&gt;
 WSUS&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2891</id>
		<title>Samba4 Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2891"/>
		<updated>2016-02-06T00:12:51Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
&lt;br /&gt;
==Update Samba==&lt;br /&gt;
*When updating Samba you should only be doing a version change on one DC at a time. Then verify that the DC is working in the domain before upgrading other DCs, don't update more than one DC at a time, have proper backups!&lt;br /&gt;
*https://wiki.samba.org/index.php/Updating_Samba&lt;br /&gt;
*Stop service and make backup&lt;br /&gt;
 systemctl stop samba&lt;br /&gt;
 /usr/local/samba/bin/samba_backup&lt;br /&gt;
*Get samba, configure and install&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.3.3.tar.gz&lt;br /&gt;
 tar -zxvf samba-4.3.3.tar.gz&lt;br /&gt;
 cd ~/samba-4.3.3&lt;br /&gt;
 ./configure --enable-debug --enable-selftest --with-ads --with-systemd --with-winbind&lt;br /&gt;
*Make sure configure completes successfully, be sure you have proper backups!!!&lt;br /&gt;
*Read the release notes to check compatibility. &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
*start the samba service&lt;br /&gt;
 systemctl start samba&lt;br /&gt;
*Go check the logs and verify the system came up correctly:&lt;br /&gt;
 tail /usr/local/samba/var/$LOGNAME.log&lt;br /&gt;
*Test around and see that replication is still in sync. Check that other DCs logs for errors about upgraded DC or replication.&lt;br /&gt;
&lt;br /&gt;
==Checking Replication==&lt;br /&gt;
*Check replication status &lt;br /&gt;
 samba-tool drs showrepl&lt;br /&gt;
*Force a repl:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba-tool_drs_replicate&lt;br /&gt;
&lt;br /&gt;
==Force Removal of DC==&lt;br /&gt;
*If a Samba4 DC goes offline and cannot be restored so that replication can resync with another DC it must be forcibly removed from the domain.&lt;br /&gt;
*If the failed DC owned any of the FSMO roles they must be seized by the current working DC. See link for howto:&lt;br /&gt;
*https://wiki.samba.org/index.php/Transfering_/_seizing_FSMO_roles&lt;br /&gt;
*Once all roles are on a working DC you may force remove the down DC from the domain. Use the following script:&lt;br /&gt;
*https://gallery.technet.microsoft.com/scriptcenter/d31f091f-2642-4ede-9f97-0e1cc4d577f3#content&lt;br /&gt;
*Check in ADUC under Domain Controllers(or appropriate OU) the DC was removed, if not delete the object.&lt;br /&gt;
*Open up the DNS Manager and remove all entries for the failed DC.&lt;br /&gt;
*Never restore/reintroduce the failed DC back into the domain, it will cause replication issues.&lt;br /&gt;
*To bring another DC up, setup samba as usual and join the domain as a DC using samba-tool:&lt;br /&gt;
*https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory&lt;br /&gt;
&lt;br /&gt;
==Demote a DC==&lt;br /&gt;
*https://wiki.samba.org/index.php/Demote_a_Samba_AD_DC&lt;br /&gt;
&lt;br /&gt;
==Join a DC==&lt;br /&gt;
*https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory&lt;br /&gt;
&lt;br /&gt;
==Backup and Restore==&lt;br /&gt;
*https://wiki.samba.org/index.php/Backup_and_restore_an_Samba_AD_DC&lt;br /&gt;
&lt;br /&gt;
==Local Intranet Settings for Roaming Profiles==&lt;br /&gt;
*http://www.technipages.com/fix-we-cant-verify-who-created-this-file-error&lt;br /&gt;
*https://deployhappiness.com/managing-internet-explorer-trusted-sites-with-group-policy/&lt;br /&gt;
&lt;br /&gt;
==LDB Search/Edit==&lt;br /&gt;
*ldb search example:&lt;br /&gt;
 ldbsearch -H /usr/local/samba/private/sam.ldb.d/DC\=DOMAINDNSZONES\,DC\=***\,DC\=***\,DC\=***\,DC\=***.ldb&lt;br /&gt;
&lt;br /&gt;
*weird error with tombstone lifetime&lt;br /&gt;
 [2015/05/20 14:27:27.377734,  0] ../source4/dsdb/repl/replicated_objects.c:783(dsdb_replicated_objects_commit)&lt;br /&gt;
  Failed to apply records: replmd_replicated_apply_add: error during DRS repl ADD: No objectClass found in replPropertyMetaData for DC=lluvia\0ACNF:fe4415b8-8a9d-417d-abb3-77771ec99f88\0ADEL:fe4415b8-8a9d-417d-abb3-77771ec99f88,CN=Deleted Objects,DC=DomainDnsZones,DC=***,DC=***,DC=***,DC=edu!&lt;br /&gt;
  : Object class violation&lt;br /&gt;
*use ldbedit to change the tombstone lifetime from 6 months to 10 days to get rid of all extra &amp;quot;Deleted Objects&amp;quot; that wont replicate&lt;br /&gt;
 ldbedit -H ldap://localhost -Uadministrator -s base -b &amp;quot;CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=***,DC=***,DC=***,DC=***&amp;quot;&lt;br /&gt;
*https://wiki.samba.org/index.php/Restoring_deleted_AD_objects#Changing_the_defaults_for_msDS-deletedObjectLifetime_and_tombstoneLifetime&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Administration&amp;diff=2885</id>
		<title>Samba4 Administration</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Administration&amp;diff=2885"/>
		<updated>2016-02-04T23:50:55Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* WSUS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Quick Shortcuts/Tutorial==&lt;br /&gt;
*Lets face it navigating Windows is horrible, so lets show some quick ways of getting around to important places while not wasting much time&lt;br /&gt;
*Search in Windows 8 is subpar(especially when looking for admin tools), however commonly used tools can be opened a lot faster if using the run prompt provided by windows &lt;br /&gt;
*How To Open Run Prompt: Keyboard Shortcut&lt;br /&gt;
**Windows Key + R&lt;br /&gt;
*If on a Mac and using Remote Desktop the shortcut is:&lt;br /&gt;
**Command + R&lt;br /&gt;
*The following prompt should pop up:&lt;br /&gt;
[[File:win_R.png|Windows Key + R]]&lt;br /&gt;
*Here is a list of important commands that can be run here that open up the applications we will use most often:&lt;br /&gt;
**cmd  -  opens up a non-administrative windows command prompt   &lt;br /&gt;
**regedit  -  opens up the local computer registry editor(not needed really, registry settings can be applied via GPO)&lt;br /&gt;
**control  -  opens up the Windows Control Panel where most(all) settings can be changed via GUI &lt;br /&gt;
**'''control admintools'''  -  opens up Administrative Tools, if you can't find something this is where it probably is!!!&lt;br /&gt;
*The rest of the list can be opened from Administrative Tools. but i included them to be accessed faster if need be:&lt;br /&gt;
**dsa.msc  -  Active Directory Users and Computers, here you can add an edit new users or computers in the domain&lt;br /&gt;
**gpmc.msc  -  Group Policy Management, here you can view and edit Group Policy Objects(GPOs) applied to the domain&lt;br /&gt;
**eventvwr  -  Event Viewer, Windows log files, this is where your errors/warnings will be when troubleshooting windows&lt;br /&gt;
*Here is the administrative tools folder, we will mostly be in Active Directory Users and Computers and Group Policy Management &lt;br /&gt;
[[File:win_r_admin.png|900px|Admin Tools]]&lt;br /&gt;
&lt;br /&gt;
==Managing Domain==&lt;br /&gt;
*To Manage, Add Users, change settings, edit GPO's, view DNS entires, etc. for the domain it should be done from a Windows 7 or Higher, or Server 2012 or higher Computer&lt;br /&gt;
*Any computer on the Domain can manage the domain controller(rumba), as long as you are an Administrator to the Domain and have RSAT installed(see below)&lt;br /&gt;
*Because there are two domain controllers you want to make sure you are making your changes to rumba and not limbo&lt;br /&gt;
*'''NOTE:''' if you're going to do the following run a backup first: &lt;br /&gt;
*Any GPO edits will have to be manually rsynced to limbo(you want to make your changes on rumba)&lt;br /&gt;
**This can and will be scripted, at the moment not enough testing has been done to ensure the script will not mess up the GPO's(basically the SYSVOL folder) which can lead to corruption and a huge headache if there are no recent backups&lt;br /&gt;
**How to rsync: run this command, its a dry run, ensure those are the changes and files that want to me rsynced over&lt;br /&gt;
**This as an '''IMPORTANT''' reminder: rsync --options '''SOURCE''' '''DESTINATION'''  &lt;br /&gt;
**Do not mess up the SOURCE and DESTINATION addresses, this will cause corruption &lt;br /&gt;
**Last Note: RUN this command on LIMBO!!, you want to pull your data, not push it&lt;br /&gt;
 rsync --dry-run -XAavz --delete-after root@rumba:/usr/local/samba/var/locks/sysvol/ /usr/local/samba/var/locks/sysvol/&lt;br /&gt;
*that was the dry run version, it will only tell you what files it will overwrite/write if run without the dry-run option, once you have seen the dry-run output and want to copy those files run:&lt;br /&gt;
 rsync -XAavz --delete-after root@rumba:/usr/local/samba/var/locks/sysvol/ /usr/local/samba/var/locks/sysvol/&lt;br /&gt;
&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*If not installed on your Windows Computer Remote Server Administration Tools(RSAT) will have to be downloaded and installed&lt;br /&gt;
*If your running a Windows Server version they are already installed you usually just must enable them(skip down to enabling RSAT after installing) &lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool(Really just the Active Directory, Group Policy, and DNS stuff), then click okay&lt;br /&gt;
==Creating Users==&lt;br /&gt;
*users can be created in two ways:&lt;br /&gt;
*they can be done through the gui provided by RSAT(Remote Service Administration Tools)  to add users into Active Directory (AD)&lt;br /&gt;
*simply click new user in the appropriate OU (organizational unit) and enter in name,username and password&lt;br /&gt;
*The AD LDAP schema has been extended to allow the storage of UIDS in Active Directory&lt;br /&gt;
*To change a users UID, click properties on a user under Active Directory Users and Computers, on the properties tab click UNIX Attributes &lt;br /&gt;
**Click the NIS Domain of EADM and give them a UID, login shell can be /bin/false or /sh(later on we'll try logging in linux users against AD)&lt;br /&gt;
**Give them a home(doesnt matter for now as we are not allowing linux users to authenticate against ad yet)&lt;br /&gt;
**Add them to a primary group, for most users the group of &amp;quot;Domain Users&amp;quot; is fine&lt;br /&gt;
*To create user into AD using terminal use samba-tool&lt;br /&gt;
 samba-tool user add USERNAME&lt;br /&gt;
*This will create a user in the default OU of Users, to manage this user use RSAT&lt;br /&gt;
==Giving User a Profile==&lt;br /&gt;
*Once a user is added he might need to be given a roaming profile&lt;br /&gt;
**Roaming profiles live on the server, whenever a user logins in the profile is loaded from the server and the users local profile(if there is one) is update to reflect any changes that are on that roaming profile on the server, on logout the changes the user has made are sent back to the server and stored there as well as the local profile&lt;br /&gt;
**Key Point: On login user pulls info from server, on logout user pushes changes back, if the server is down the user can still login but he will login to the most recent local profile stored on the computer, changes will not be pushed back on logout if there is no domain controller, the system will warn you and may even log you in with a temporary profile, unless the server comes back up and you are able to logout eventually after making changes to the local profile there is a chance your roaming profile will not be updated with your settings/files&lt;br /&gt;
**This is a good setup for Administrators who will be logging in to multiple machines at the same time without logging out or carrying a lot of files in there profiles &lt;br /&gt;
**allows you to move scripts and useful files with you on login, mount a few drives and make changes, also good if your anything like me and login into 4 computers at the same time(note be careful with this) usually your profile will most accurately reflect the changes you made to the same file on the last computer you logout from(i believe timestamps are taken to consideration as well)&lt;br /&gt;
*Local Profiles&lt;br /&gt;
**Local profiles has it pros and cons&lt;br /&gt;
**Pros: for the default Administrator account it is perfect, no files should be carried around on an Administrator profile, all changes to the profile stay local to the machine and are not synced back to the server, if you login to two separate computers with the Administrator account all changes will stay local to there separate computers. This is probaly good as well for users who work at home but sometimes bring there laptops in to work here, at home all there files stay local to there machine they will always have what they need locally, when they connect to our network and login, GPO's can be applied and they can have network mounted drives and firewall settings implemented automatically&lt;br /&gt;
**Cons: For the user, there is no backup of there profile, if they have no backups and there hard drive crahes/act of god/ etc. it is gone, there would be no way to recover the users settings and files(not completely, look below at Folder Redirection)  &lt;br /&gt;
*Folder Redirection&lt;br /&gt;
**Here is where it gets a little tricky, we can have folder redirection with local profiles, and we can also have folder redirection with roaming profiles, or we can have none at all&lt;br /&gt;
**Usually folder redirection will want to be implemented on a users Roaming Profile if in his home directory he/she has gigabytes worth of data (2-1000+GB), this will increase there login/logout times significantly as well as keep all there information on the server&lt;br /&gt;
*Roaming profiles with folder redirection allows the profile to be kept small(usually only the size of the AppData folder which is around 100mb), while the users profile(basically now just settings) still &amp;quot;Roams&amp;quot; the Folder setup for redirection(Usually Documents, Pictures, Videos, Music, etc.) will not roam in the same way. The Client will instead now pull and push data as changes are made, the information will reside on the local client and server, whenever the client makes a change to any Folder that is &amp;quot;redirected&amp;quot; the changes will be updated on the server immediately&lt;br /&gt;
**on logout only the changes that are made to the &amp;quot;roaming&amp;quot; part of the profile(again usually just APPData folder) will be pushed back to the server, the redirected folders have been synced in real time and will not have to be sent back unless a file was recently edited before logout. &lt;br /&gt;
**Cons: this type of setup doesn't really work if you log into a lot of machines at once. Yea your files on one machine get updated immediately if you are working on them from another, but because Folder Sync will be working on both(or more) computers at the same time trying to update al the files that change at once (including settings files that programs decide to stupidly store in Documents instead of APPData) corruption generally happens pretty quickly. If you only login to one machine and use that as your main machine you really shouldn't experience any problems, the problems arise when logging in from different machines at the same time and even different versions of windows&lt;br /&gt;
*Local Profiles with Folder Redirection&lt;br /&gt;
**Dont really have this setup anywhere but there are uses for it&lt;br /&gt;
**Same as above if user doesn't move between computers and wants his files on the server updated automatically, profile info(basically just settings) just live on his computer&lt;br /&gt;
**this is good if the user wants all his files on the server and logins in from different versions of windows(his settings will be local to each machine) this to however can be setup up with Roaming profiles &lt;br /&gt;
==GPO Office==&lt;br /&gt;
*admx files must be downloaded for each version of microsoft office that clients use(office 2007, 2010, etc.)&lt;br /&gt;
*run a &amp;quot;gpudate \force&amp;quot; if you dont see them appear in group policy editor&lt;br /&gt;
*once placed in policyDefinitions under sysvol GPO may be applied to that specific version of office&lt;br /&gt;
*User Configuration-&amp;gt;Administrative Templates -&amp;gt;&amp;quot;Microsoft Office [version]&amp;quot; -&amp;gt;Privacy-&amp;gt;Trust Center&lt;br /&gt;
*enable the &amp;quot;Disable opt-in..&amp;quot;, disable &amp;quot;Enable Customer Experience...&amp;quot; and &amp;quot;Automatically receive small..&amp;quot;  &lt;br /&gt;
*must be done for every version of office clients are running(annoying pop up messages when office starts  if this is not set)&lt;br /&gt;
==GPO Windows Update==&lt;br /&gt;
*locate a copy of wuau.adm and install into PolicyDefinitions&lt;br /&gt;
*Windows update group policy should be set up on a per machine bases(GPO applied to Machines not Users)&lt;br /&gt;
*Computer Configuration -&amp;gt;Policies-&amp;gt; Administrative Templates -&amp;gt;Windows Components-&amp;gt;Windows Update&lt;br /&gt;
 Configure Automatic Update: Enabled&lt;br /&gt;
 Allow non-administrators to receive update notifications: enabled &lt;br /&gt;
 Allow Automatic Updates Immediate installations: enabled&lt;br /&gt;
 No auto-restart with logged in users: enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installation: enabled&lt;br /&gt;
==GPO Network, Firewall, Remote Desktop Connections==&lt;br /&gt;
*GPO for RDC are in two locations&lt;br /&gt;
*Computer Configuration-&amp;gt;Policies-&amp;gt;Administrative Templates-&amp;gt;Network-&amp;gt;Network Connections-&amp;gt;Windows Firewall-&amp;gt; Domain Profile&lt;br /&gt;
 Windows Firewall:Allow inbound Remote Desktop conneciotns&lt;br /&gt;
*limit to subnets of eri and vpn&lt;br /&gt;
 Windows Firewall: Allow ICMP exceptions: Enabled&lt;br /&gt;
*check Allow inbound echo Request&lt;br /&gt;
*Computer Configuration-&amp;gt;Policies-&amp;gt;Administrative Templates-&amp;gt;Windows Components-&amp;gt;Remote Desktop Connection Host-&amp;gt;Connections&lt;br /&gt;
 Allow users to connect remotely using Remote Desktop Services: enabled&lt;br /&gt;
*to allow specific users/group login:&lt;br /&gt;
*Computer Configuration-&amp;gt;Policies-&amp;gt;Windows Settings-&amp;gt;Security Settings-&amp;gt;Restricted Groups&lt;br /&gt;
*create Remote Desktop Users group if not created, add users manually into group or add an entire group to allow Remote Desktop Connections&lt;br /&gt;
*DNS suffix search list&lt;br /&gt;
*Computer Configuration-&amp;gt;Policies-&amp;gt;Administrative Templates =&amp;gt; Netowrk =&amp;gt; DNS client =&amp;gt; DNS suffix search list&lt;br /&gt;
**Enabled: mydomain.edu, name.mydomain.edu&lt;br /&gt;
==Profile Version for Windows Server 2012==&lt;br /&gt;
*If you are using roaming profiles and using any of the following operating Systems you must enable the .V3 extension on roaming profiles&lt;br /&gt;
*Operating systems: Windows 8.1, Windows 8, Windows Server 2012 R2, or Windows Server 2012&lt;br /&gt;
*Link: http://technet.microsoft.com/en-us/library/jj649079.aspx&lt;br /&gt;
*Basically you install an update from Microsoft and edit a registry key so that Windows Server 2012 will pick up the profile with the .V3 extension instead of .V2 which is used for Windows 7&lt;br /&gt;
&lt;br /&gt;
==MAC==&lt;br /&gt;
*https://lists.samba.org/archive/samba/2013-June/174090.html&lt;br /&gt;
==WSUS==&lt;br /&gt;
*http://mizitechinfo.wordpress.com/2013/08/19/step-by-step-installing-configuring-wsus-in-server-2012-r2/&lt;br /&gt;
*http://technet.microsoft.com/en-us/library/hh852344.aspx&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2884</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2884"/>
		<updated>2016-02-04T23:50:42Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Windows Update GPO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.   &lt;br /&gt;
&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
Samba Ports needed here:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_port_usage&lt;br /&gt;
*settings(old?):&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few minutes apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
*Samba wiki's:&lt;br /&gt;
**https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
**https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/domain&lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/domain&lt;br /&gt;
 read only = No&lt;br /&gt;
 hide files = /desktop.ini/$RECYCLE.BIN/&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
Follow:&lt;br /&gt;
*https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
*https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From windows command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO/WSUS==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_BDC&amp;diff=2883</id>
		<title>Samba4 BDC</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_BDC&amp;diff=2883"/>
		<updated>2016-02-04T23:41:03Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Required Packages==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make backup of kerberos conf&lt;br /&gt;
 cp /etc/krb5.conf /etc/krb5.bak&lt;br /&gt;
*add realm to kerberos file /etc/krb5.conf&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*change ${REALM} variable to your realm&lt;br /&gt;
*test that you can kinit&lt;br /&gt;
 kinit administrator&lt;br /&gt;
*type password then klist to check if you have ticket&lt;br /&gt;
 klsit&lt;br /&gt;
&lt;br /&gt;
==Join DC to domain==&lt;br /&gt;
*if kerberos is working check that you can see the PDC dns entries&lt;br /&gt;
*then join DC to domain&lt;br /&gt;
 samba-tool domain join example.edu DC -Uadministrator --realm=example.edu&lt;br /&gt;
*should end with &lt;br /&gt;
 Joined domain EXAMPLE (SID ...) as a DC&lt;br /&gt;
&lt;br /&gt;
==Transfer Roles==&lt;br /&gt;
*DNS entries must ne setup before you can transfer roles, samba must be running (check log before for any errors)&lt;br /&gt;
 *see who has what roles&lt;br /&gt;
 samba-tool fsmo show&lt;br /&gt;
*transfer them all(can also transfer individual roles)&lt;br /&gt;
 samba-tool fsmo transfer --role=all&lt;br /&gt;
&lt;br /&gt;
==nssswitch==&lt;br /&gt;
*enumerate users in getent passwd&lt;br /&gt;
*link winbind so nsswitch can see&lt;br /&gt;
 ln -s  /usr/local/samba/lib/libnss_winbind.so.2  /lib64/libnss_winbind.so&lt;br /&gt;
 ln  -s /lib64/libnss_winbind.so  /lib64/libnss_winbind.so.2&lt;br /&gt;
*check that it is linked&lt;br /&gt;
 ldconfig -v | grep winbind&lt;br /&gt;
&lt;br /&gt;
*edit /etc/nssswitch to contain&lt;br /&gt;
 passwd:     files winbind&lt;br /&gt;
 shadow:     files&lt;br /&gt;
 group:      files winbind&lt;br /&gt;
==SYSVOL==&lt;br /&gt;
*syncing&lt;br /&gt;
 rsync --dry-run -XAavz --delete-after root@&amp;quot;HOSTNAME&amp;quot;:/usr/local/samba/var/locks/sysvol/ /usr/local/samba/var/locks/sysvol/&lt;br /&gt;
 rsync -XAavz --delete-after root@&amp;quot;HOSTNAME&amp;quot;:/usr/local/samba/var/locks/sysvol/ /usr/local/samba/var/locks/sysvol/&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2882</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2882"/>
		<updated>2016-02-04T23:30:49Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Adding User and profile path */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.   &lt;br /&gt;
&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
Samba Ports needed here:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_port_usage&lt;br /&gt;
*settings(old?):&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few minutes apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
*Samba wiki's:&lt;br /&gt;
**https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
**https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/domain&lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/domain&lt;br /&gt;
 read only = No&lt;br /&gt;
 hide files = /desktop.ini/$RECYCLE.BIN/&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
Follow:&lt;br /&gt;
*https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
*https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From windows command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2881</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2881"/>
		<updated>2016-02-04T23:28:24Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Add Windows computer to domain */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.   &lt;br /&gt;
&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
Samba Ports needed here:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_port_usage&lt;br /&gt;
*settings(old?):&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few minutes apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
*Samba wiki's:&lt;br /&gt;
**https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
**https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/domain&lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/domain&lt;br /&gt;
 read only = No&lt;br /&gt;
 hide files = /desktop.ini/$RECYCLE.BIN/&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
Follow:&lt;br /&gt;
*https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
*https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2880</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2880"/>
		<updated>2016-02-04T23:22:37Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* SSSD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.   &lt;br /&gt;
&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
Samba Ports needed here:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_port_usage&lt;br /&gt;
*settings(old?):&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few seconds apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
*Samba wiki's:&lt;br /&gt;
**https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
**https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/domain&lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/domain&lt;br /&gt;
 read only = No&lt;br /&gt;
 hide files = /desktop.ini/$RECYCLE.BIN/&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
Follow:&lt;br /&gt;
*https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
*https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Administration&amp;diff=2879</id>
		<title>Samba4 Administration</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Administration&amp;diff=2879"/>
		<updated>2016-02-04T23:19:16Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Managing Domain */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Quick Shortcuts/Tutorial==&lt;br /&gt;
*Lets face it navigating Windows is horrible, so lets show some quick ways of getting around to important places while not wasting much time&lt;br /&gt;
*Search in Windows 8 is subpar(especially when looking for admin tools), however commonly used tools can be opened a lot faster if using the run prompt provided by windows &lt;br /&gt;
*How To Open Run Prompt: Keyboard Shortcut&lt;br /&gt;
**Windows Key + R&lt;br /&gt;
*If on a Mac and using Remote Desktop the shortcut is:&lt;br /&gt;
**Command + R&lt;br /&gt;
*The following prompt should pop up:&lt;br /&gt;
[[File:win_R.png|Windows Key + R]]&lt;br /&gt;
*Here is a list of important commands that can be run here that open up the applications we will use most often:&lt;br /&gt;
**cmd  -  opens up a non-administrative windows command prompt   &lt;br /&gt;
**regedit  -  opens up the local computer registry editor(not needed really, registry settings can be applied via GPO)&lt;br /&gt;
**control  -  opens up the Windows Control Panel where most(all) settings can be changed via GUI &lt;br /&gt;
**'''control admintools'''  -  opens up Administrative Tools, if you can't find something this is where it probably is!!!&lt;br /&gt;
*The rest of the list can be opened from Administrative Tools. but i included them to be accessed faster if need be:&lt;br /&gt;
**dsa.msc  -  Active Directory Users and Computers, here you can add an edit new users or computers in the domain&lt;br /&gt;
**gpmc.msc  -  Group Policy Management, here you can view and edit Group Policy Objects(GPOs) applied to the domain&lt;br /&gt;
**eventvwr  -  Event Viewer, Windows log files, this is where your errors/warnings will be when troubleshooting windows&lt;br /&gt;
*Here is the administrative tools folder, we will mostly be in Active Directory Users and Computers and Group Policy Management &lt;br /&gt;
[[File:win_r_admin.png|900px|Admin Tools]]&lt;br /&gt;
&lt;br /&gt;
==Managing Domain==&lt;br /&gt;
*To Manage, Add Users, change settings, edit GPO's, view DNS entires, etc. for the domain it should be done from a Windows 7 or Higher, or Server 2012 or higher Computer&lt;br /&gt;
*Any computer on the Domain can manage the domain controller(rumba), as long as you are an Administrator to the Domain and have RSAT installed(see below)&lt;br /&gt;
*Because there are two domain controllers you want to make sure you are making your changes to rumba and not limbo&lt;br /&gt;
*'''NOTE:''' if you're going to do the following run a backup first: &lt;br /&gt;
*Any GPO edits will have to be manually rsynced to limbo(you want to make your changes on rumba)&lt;br /&gt;
**This can and will be scripted, at the moment not enough testing has been done to ensure the script will not mess up the GPO's(basically the SYSVOL folder) which can lead to corruption and a huge headache if there are no recent backups&lt;br /&gt;
**How to rsync: run this command, its a dry run, ensure those are the changes and files that want to me rsynced over&lt;br /&gt;
**This as an '''IMPORTANT''' reminder: rsync --options '''SOURCE''' '''DESTINATION'''  &lt;br /&gt;
**Do not mess up the SOURCE and DESTINATION addresses, this will cause corruption &lt;br /&gt;
**Last Note: RUN this command on LIMBO!!, you want to pull your data, not push it&lt;br /&gt;
 rsync --dry-run -XAavz --delete-after root@rumba:/usr/local/samba/var/locks/sysvol/ /usr/local/samba/var/locks/sysvol/&lt;br /&gt;
*that was the dry run version, it will only tell you what files it will overwrite/write if run without the dry-run option, once you have seen the dry-run output and want to copy those files run:&lt;br /&gt;
 rsync -XAavz --delete-after root@rumba:/usr/local/samba/var/locks/sysvol/ /usr/local/samba/var/locks/sysvol/&lt;br /&gt;
&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*If not installed on your Windows Computer Remote Server Administration Tools(RSAT) will have to be downloaded and installed&lt;br /&gt;
*If your running a Windows Server version they are already installed you usually just must enable them(skip down to enabling RSAT after installing) &lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool(Really just the Active Directory, Group Policy, and DNS stuff), then click okay&lt;br /&gt;
==Creating Users==&lt;br /&gt;
*users can be created in two ways:&lt;br /&gt;
*they can be done through the gui provided by RSAT(Remote Service Administration Tools)  to add users into Active Directory (AD)&lt;br /&gt;
*simply click new user in the appropriate OU (organizational unit) and enter in name,username and password&lt;br /&gt;
*The AD LDAP schema has been extended to allow the storage of UIDS in Active Directory&lt;br /&gt;
*To change a users UID, click properties on a user under Active Directory Users and Computers, on the properties tab click UNIX Attributes &lt;br /&gt;
**Click the NIS Domain of EADM and give them a UID, login shell can be /bin/false or /sh(later on we'll try logging in linux users against AD)&lt;br /&gt;
**Give them a home(doesnt matter for now as we are not allowing linux users to authenticate against ad yet)&lt;br /&gt;
**Add them to a primary group, for most users the group of &amp;quot;Domain Users&amp;quot; is fine&lt;br /&gt;
*To create user into AD using terminal use samba-tool&lt;br /&gt;
 samba-tool user add USERNAME&lt;br /&gt;
*This will create a user in the default OU of Users, to manage this user use RSAT&lt;br /&gt;
==Giving User a Profile==&lt;br /&gt;
*Once a user is added he might need to be given a roaming profile&lt;br /&gt;
**Roaming profiles live on the server, whenever a user logins in the profile is loaded from the server and the users local profile(if there is one) is update to reflect any changes that are on that roaming profile on the server, on logout the changes the user has made are sent back to the server and stored there as well as the local profile&lt;br /&gt;
**Key Point: On login user pulls info from server, on logout user pushes changes back, if the server is down the user can still login but he will login to the most recent local profile stored on the computer, changes will not be pushed back on logout if there is no domain controller, the system will warn you and may even log you in with a temporary profile, unless the server comes back up and you are able to logout eventually after making changes to the local profile there is a chance your roaming profile will not be updated with your settings/files&lt;br /&gt;
**This is a good setup for Administrators who will be logging in to multiple machines at the same time without logging out or carrying a lot of files in there profiles &lt;br /&gt;
**allows you to move scripts and useful files with you on login, mount a few drives and make changes, also good if your anything like me and login into 4 computers at the same time(note be careful with this) usually your profile will most accurately reflect the changes you made to the same file on the last computer you logout from(i believe timestamps are taken to consideration as well)&lt;br /&gt;
*Local Profiles&lt;br /&gt;
**Local profiles has it pros and cons&lt;br /&gt;
**Pros: for the default Administrator account it is perfect, no files should be carried around on an Administrator profile, all changes to the profile stay local to the machine and are not synced back to the server, if you login to two separate computers with the Administrator account all changes will stay local to there separate computers. This is probaly good as well for users who work at home but sometimes bring there laptops in to work here, at home all there files stay local to there machine they will always have what they need locally, when they connect to our network and login, GPO's can be applied and they can have network mounted drives and firewall settings implemented automatically&lt;br /&gt;
**Cons: For the user, there is no backup of there profile, if they have no backups and there hard drive crahes/act of god/ etc. it is gone, there would be no way to recover the users settings and files(not completely, look below at Folder Redirection)  &lt;br /&gt;
*Folder Redirection&lt;br /&gt;
**Here is where it gets a little tricky, we can have folder redirection with local profiles, and we can also have folder redirection with roaming profiles, or we can have none at all&lt;br /&gt;
**Usually folder redirection will want to be implemented on a users Roaming Profile if in his home directory he/she has gigabytes worth of data (2-1000+GB), this will increase there login/logout times significantly as well as keep all there information on the server&lt;br /&gt;
*Roaming profiles with folder redirection allows the profile to be kept small(usually only the size of the AppData folder which is around 100mb), while the users profile(basically now just settings) still &amp;quot;Roams&amp;quot; the Folder setup for redirection(Usually Documents, Pictures, Videos, Music, etc.) will not roam in the same way. The Client will instead now pull and push data as changes are made, the information will reside on the local client and server, whenever the client makes a change to any Folder that is &amp;quot;redirected&amp;quot; the changes will be updated on the server immediately&lt;br /&gt;
**on logout only the changes that are made to the &amp;quot;roaming&amp;quot; part of the profile(again usually just APPData folder) will be pushed back to the server, the redirected folders have been synced in real time and will not have to be sent back unless a file was recently edited before logout. &lt;br /&gt;
**Cons: this type of setup doesn't really work if you log into a lot of machines at once. Yea your files on one machine get updated immediately if you are working on them from another, but because Folder Sync will be working on both(or more) computers at the same time trying to update al the files that change at once (including settings files that programs decide to stupidly store in Documents instead of APPData) corruption generally happens pretty quickly. If you only login to one machine and use that as your main machine you really shouldn't experience any problems, the problems arise when logging in from different machines at the same time and even different versions of windows&lt;br /&gt;
*Local Profiles with Folder Redirection&lt;br /&gt;
**Dont really have this setup anywhere but there are uses for it&lt;br /&gt;
**Same as above if user doesn't move between computers and wants his files on the server updated automatically, profile info(basically just settings) just live on his computer&lt;br /&gt;
**this is good if the user wants all his files on the server and logins in from different versions of windows(his settings will be local to each machine) this to however can be setup up with Roaming profiles &lt;br /&gt;
==GPO Office==&lt;br /&gt;
*admx files must be downloaded for each version of microsoft office that clients use(office 2007, 2010, etc.)&lt;br /&gt;
*run a &amp;quot;gpudate \force&amp;quot; if you dont see them appear in group policy editor&lt;br /&gt;
*once placed in policyDefinitions under sysvol GPO may be applied to that specific version of office&lt;br /&gt;
*User Configuration-&amp;gt;Administrative Templates -&amp;gt;&amp;quot;Microsoft Office [version]&amp;quot; -&amp;gt;Privacy-&amp;gt;Trust Center&lt;br /&gt;
*enable the &amp;quot;Disable opt-in..&amp;quot;, disable &amp;quot;Enable Customer Experience...&amp;quot; and &amp;quot;Automatically receive small..&amp;quot;  &lt;br /&gt;
*must be done for every version of office clients are running(annoying pop up messages when office starts  if this is not set)&lt;br /&gt;
==GPO Windows Update==&lt;br /&gt;
*locate a copy of wuau.adm and install into PolicyDefinitions&lt;br /&gt;
*Windows update group policy should be set up on a per machine bases(GPO applied to Machines not Users)&lt;br /&gt;
*Computer Configuration -&amp;gt;Policies-&amp;gt; Administrative Templates -&amp;gt;Windows Components-&amp;gt;Windows Update&lt;br /&gt;
 Configure Automatic Update: Enabled&lt;br /&gt;
 Allow non-administrators to receive update notifications: enabled &lt;br /&gt;
 Allow Automatic Updates Immediate installations: enabled&lt;br /&gt;
 No auto-restart with logged in users: enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installation: enabled&lt;br /&gt;
==GPO Network, Firewall, Remote Desktop Connections==&lt;br /&gt;
*GPO for RDC are in two locations&lt;br /&gt;
*Computer Configuration-&amp;gt;Policies-&amp;gt;Administrative Templates-&amp;gt;Network-&amp;gt;Network Connections-&amp;gt;Windows Firewall-&amp;gt; Domain Profile&lt;br /&gt;
 Windows Firewall:Allow inbound Remote Desktop conneciotns&lt;br /&gt;
*limit to subnets of eri and vpn&lt;br /&gt;
 Windows Firewall: Allow ICMP exceptions: Enabled&lt;br /&gt;
*check Allow inbound echo Request&lt;br /&gt;
*Computer Configuration-&amp;gt;Policies-&amp;gt;Administrative Templates-&amp;gt;Windows Components-&amp;gt;Remote Desktop Connection Host-&amp;gt;Connections&lt;br /&gt;
 Allow users to connect remotely using Remote Desktop Services: enabled&lt;br /&gt;
*to allow specific users/group login:&lt;br /&gt;
*Computer Configuration-&amp;gt;Policies-&amp;gt;Windows Settings-&amp;gt;Security Settings-&amp;gt;Restricted Groups&lt;br /&gt;
*create Remote Desktop Users group if not created, add users manually into group or add an entire group to allow Remote Desktop Connections&lt;br /&gt;
*DNS suffix search list&lt;br /&gt;
*Computer Configuration-&amp;gt;Policies-&amp;gt;Administrative Templates =&amp;gt; Netowrk =&amp;gt; DNS client =&amp;gt; DNS suffix search list&lt;br /&gt;
**Enabled: mydomain.edu, name.mydomain.edu&lt;br /&gt;
==Profile Version for Windows Server 2012==&lt;br /&gt;
*If you are using roaming profiles and using any of the following operating Systems you must enable the .V3 extension on roaming profiles&lt;br /&gt;
*Operating systems: Windows 8.1, Windows 8, Windows Server 2012 R2, or Windows Server 2012&lt;br /&gt;
*Link: http://technet.microsoft.com/en-us/library/jj649079.aspx&lt;br /&gt;
*Basically you install an update from Microsoft and edit a registry key so that Windows Server 2012 will pick up the profile with the .V3 extension instead of .V2 which is used for Windows 7&lt;br /&gt;
&lt;br /&gt;
==MAC==&lt;br /&gt;
*https://lists.samba.org/archive/samba/2013-June/174090.html&lt;br /&gt;
==WSUS==&lt;br /&gt;
*http://mizitechinfo.wordpress.com/2013/08/19/step-by-step-installing-configuring-wsus-in-server-2012-r2/&lt;br /&gt;
*http://technet.microsoft.com/en-us/library/hh852344.aspx&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2878</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2878"/>
		<updated>2016-02-04T23:16:05Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Adding Profile path to Samba */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.   &lt;br /&gt;
&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
Samba Ports needed here:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_port_usage&lt;br /&gt;
*settings(old?):&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few seconds apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
*Samba wiki's:&lt;br /&gt;
**https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
**https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/domain&lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/domain&lt;br /&gt;
 read only = No&lt;br /&gt;
 hide files = /desktop.ini/$RECYCLE.BIN/&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
Follow:&lt;br /&gt;
*https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
*https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==SSSD==&lt;br /&gt;
 vim /etc/sssd/sssd.conf&lt;br /&gt;
 [domain/default]&lt;br /&gt;
 ldap_tls_reqcert = allow&lt;br /&gt;
 ldap_id_use_start_tls = True&lt;br /&gt;
 cache_credentials = True&lt;br /&gt;
 ldap_search_base = dc=domain,dc=edu&lt;br /&gt;
 krb5_realm = $REALM&lt;br /&gt;
 id_provider = ldap&lt;br /&gt;
 auth_provider = ldap&lt;br /&gt;
 chpass_provider = ldap&lt;br /&gt;
 ldap_uri = ldap://domain.edu&lt;br /&gt;
 ldap_tls_cacertdir = /etc/openldap/cacerts&lt;br /&gt;
 ldap_schema = rfc2307bis&lt;br /&gt;
 ldap_user_fullname = displayName&lt;br /&gt;
 ldap_user_search_base = ou=idmap,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_search_base = ou=Group,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_member = member&lt;br /&gt;
 ldap_group_nesting_level = 4&lt;br /&gt;
 ldap_tls_cacert = /etc/openldap/cacerts/cacert.pem&lt;br /&gt;
 ldap_tls_reqcert = demand&lt;br /&gt;
 ldap_default_bind_dn = cn=Manager,dc=domain,dc=edu&lt;br /&gt;
 ldap_default_authtok_type = password&lt;br /&gt;
 ldap_default_authtok = ******&lt;br /&gt;
 debug_level = 8&lt;br /&gt;
 [sssd]&lt;br /&gt;
 services = nss, pam&lt;br /&gt;
 config_file_version = 2&lt;br /&gt;
 domains = default&lt;br /&gt;
 [nss]  &lt;br /&gt;
&lt;br /&gt;
 [pam]&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2877</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2877"/>
		<updated>2016-02-04T23:15:19Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Adding Profile path to Samba */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.   &lt;br /&gt;
&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
Samba Ports needed here:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_port_usage&lt;br /&gt;
*settings(old?):&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few seconds apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
*Samba wiki's:&lt;br /&gt;
**https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
**https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/domain&lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/domain&lt;br /&gt;
 read only = No&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
Follow:&lt;br /&gt;
*https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
*https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==SSSD==&lt;br /&gt;
 vim /etc/sssd/sssd.conf&lt;br /&gt;
 [domain/default]&lt;br /&gt;
 ldap_tls_reqcert = allow&lt;br /&gt;
 ldap_id_use_start_tls = True&lt;br /&gt;
 cache_credentials = True&lt;br /&gt;
 ldap_search_base = dc=domain,dc=edu&lt;br /&gt;
 krb5_realm = $REALM&lt;br /&gt;
 id_provider = ldap&lt;br /&gt;
 auth_provider = ldap&lt;br /&gt;
 chpass_provider = ldap&lt;br /&gt;
 ldap_uri = ldap://domain.edu&lt;br /&gt;
 ldap_tls_cacertdir = /etc/openldap/cacerts&lt;br /&gt;
 ldap_schema = rfc2307bis&lt;br /&gt;
 ldap_user_fullname = displayName&lt;br /&gt;
 ldap_user_search_base = ou=idmap,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_search_base = ou=Group,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_member = member&lt;br /&gt;
 ldap_group_nesting_level = 4&lt;br /&gt;
 ldap_tls_cacert = /etc/openldap/cacerts/cacert.pem&lt;br /&gt;
 ldap_tls_reqcert = demand&lt;br /&gt;
 ldap_default_bind_dn = cn=Manager,dc=domain,dc=edu&lt;br /&gt;
 ldap_default_authtok_type = password&lt;br /&gt;
 ldap_default_authtok = ******&lt;br /&gt;
 debug_level = 8&lt;br /&gt;
 [sssd]&lt;br /&gt;
 services = nss, pam&lt;br /&gt;
 config_file_version = 2&lt;br /&gt;
 domains = default&lt;br /&gt;
 [nss]  &lt;br /&gt;
&lt;br /&gt;
 [pam]&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2876</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2876"/>
		<updated>2016-02-04T23:14:12Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Adding Profile path to Samba */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.   &lt;br /&gt;
&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
Samba Ports needed here:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_port_usage&lt;br /&gt;
*settings(old?):&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few seconds apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
*Samba wiki's:&lt;br /&gt;
**https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
**https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/samba/var/profiles &lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/samba/var/profiles &lt;br /&gt;
 read only = No&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
Follow:&lt;br /&gt;
*https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
*https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==SSSD==&lt;br /&gt;
 vim /etc/sssd/sssd.conf&lt;br /&gt;
 [domain/default]&lt;br /&gt;
 ldap_tls_reqcert = allow&lt;br /&gt;
 ldap_id_use_start_tls = True&lt;br /&gt;
 cache_credentials = True&lt;br /&gt;
 ldap_search_base = dc=domain,dc=edu&lt;br /&gt;
 krb5_realm = $REALM&lt;br /&gt;
 id_provider = ldap&lt;br /&gt;
 auth_provider = ldap&lt;br /&gt;
 chpass_provider = ldap&lt;br /&gt;
 ldap_uri = ldap://domain.edu&lt;br /&gt;
 ldap_tls_cacertdir = /etc/openldap/cacerts&lt;br /&gt;
 ldap_schema = rfc2307bis&lt;br /&gt;
 ldap_user_fullname = displayName&lt;br /&gt;
 ldap_user_search_base = ou=idmap,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_search_base = ou=Group,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_member = member&lt;br /&gt;
 ldap_group_nesting_level = 4&lt;br /&gt;
 ldap_tls_cacert = /etc/openldap/cacerts/cacert.pem&lt;br /&gt;
 ldap_tls_reqcert = demand&lt;br /&gt;
 ldap_default_bind_dn = cn=Manager,dc=domain,dc=edu&lt;br /&gt;
 ldap_default_authtok_type = password&lt;br /&gt;
 ldap_default_authtok = ******&lt;br /&gt;
 debug_level = 8&lt;br /&gt;
 [sssd]&lt;br /&gt;
 services = nss, pam&lt;br /&gt;
 config_file_version = 2&lt;br /&gt;
 domains = default&lt;br /&gt;
 [nss]  &lt;br /&gt;
&lt;br /&gt;
 [pam]&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2875</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2875"/>
		<updated>2016-02-04T23:13:44Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Change Security on Profiles folder */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.   &lt;br /&gt;
&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
Samba Ports needed here:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_port_usage&lt;br /&gt;
*settings(old?):&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few seconds apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
*Samba wiki's:&lt;br /&gt;
**https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
**https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/samba/var/profiles &lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/samba/etc/smb.conf&lt;br /&gt;
 read only = No&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
Follow:&lt;br /&gt;
*https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
*https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==SSSD==&lt;br /&gt;
 vim /etc/sssd/sssd.conf&lt;br /&gt;
 [domain/default]&lt;br /&gt;
 ldap_tls_reqcert = allow&lt;br /&gt;
 ldap_id_use_start_tls = True&lt;br /&gt;
 cache_credentials = True&lt;br /&gt;
 ldap_search_base = dc=domain,dc=edu&lt;br /&gt;
 krb5_realm = $REALM&lt;br /&gt;
 id_provider = ldap&lt;br /&gt;
 auth_provider = ldap&lt;br /&gt;
 chpass_provider = ldap&lt;br /&gt;
 ldap_uri = ldap://domain.edu&lt;br /&gt;
 ldap_tls_cacertdir = /etc/openldap/cacerts&lt;br /&gt;
 ldap_schema = rfc2307bis&lt;br /&gt;
 ldap_user_fullname = displayName&lt;br /&gt;
 ldap_user_search_base = ou=idmap,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_search_base = ou=Group,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_member = member&lt;br /&gt;
 ldap_group_nesting_level = 4&lt;br /&gt;
 ldap_tls_cacert = /etc/openldap/cacerts/cacert.pem&lt;br /&gt;
 ldap_tls_reqcert = demand&lt;br /&gt;
 ldap_default_bind_dn = cn=Manager,dc=domain,dc=edu&lt;br /&gt;
 ldap_default_authtok_type = password&lt;br /&gt;
 ldap_default_authtok = ******&lt;br /&gt;
 debug_level = 8&lt;br /&gt;
 [sssd]&lt;br /&gt;
 services = nss, pam&lt;br /&gt;
 config_file_version = 2&lt;br /&gt;
 domains = default&lt;br /&gt;
 [nss]  &lt;br /&gt;
&lt;br /&gt;
 [pam]&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2874</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2874"/>
		<updated>2016-02-04T23:12:40Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Adding Profile path to Samba */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.   &lt;br /&gt;
&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
Samba Ports needed here:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_port_usage&lt;br /&gt;
*settings(old?):&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few seconds apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
*Samba wiki's:&lt;br /&gt;
**https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
**https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/samba/var/profiles &lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/samba/etc/smb.conf&lt;br /&gt;
 read only = No&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
*login to the domain as administrator onto a windows 7 computer &lt;br /&gt;
*open up my computer and navigate to &amp;quot;\\servername&amp;quot; , ex. &amp;quot;\\samba4&amp;quot;&lt;br /&gt;
*Right Click on the folder and select properties&lt;br /&gt;
*Change security to allow Domain Administrators Full Control&lt;br /&gt;
*add Domain Users to Security with options, Traverse folder/execute file. List Folder/read data, Create folder/append data&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==SSSD==&lt;br /&gt;
 vim /etc/sssd/sssd.conf&lt;br /&gt;
 [domain/default]&lt;br /&gt;
 ldap_tls_reqcert = allow&lt;br /&gt;
 ldap_id_use_start_tls = True&lt;br /&gt;
 cache_credentials = True&lt;br /&gt;
 ldap_search_base = dc=domain,dc=edu&lt;br /&gt;
 krb5_realm = $REALM&lt;br /&gt;
 id_provider = ldap&lt;br /&gt;
 auth_provider = ldap&lt;br /&gt;
 chpass_provider = ldap&lt;br /&gt;
 ldap_uri = ldap://domain.edu&lt;br /&gt;
 ldap_tls_cacertdir = /etc/openldap/cacerts&lt;br /&gt;
 ldap_schema = rfc2307bis&lt;br /&gt;
 ldap_user_fullname = displayName&lt;br /&gt;
 ldap_user_search_base = ou=idmap,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_search_base = ou=Group,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_member = member&lt;br /&gt;
 ldap_group_nesting_level = 4&lt;br /&gt;
 ldap_tls_cacert = /etc/openldap/cacerts/cacert.pem&lt;br /&gt;
 ldap_tls_reqcert = demand&lt;br /&gt;
 ldap_default_bind_dn = cn=Manager,dc=domain,dc=edu&lt;br /&gt;
 ldap_default_authtok_type = password&lt;br /&gt;
 ldap_default_authtok = ******&lt;br /&gt;
 debug_level = 8&lt;br /&gt;
 [sssd]&lt;br /&gt;
 services = nss, pam&lt;br /&gt;
 config_file_version = 2&lt;br /&gt;
 domains = default&lt;br /&gt;
 [nss]  &lt;br /&gt;
&lt;br /&gt;
 [pam]&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2873</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2873"/>
		<updated>2016-02-04T23:12:23Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Adding Profile path to Samba */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.   &lt;br /&gt;
&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
Samba Ports needed here:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_port_usage&lt;br /&gt;
*settings(old?):&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few seconds apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
Samba wiki's:&lt;br /&gt;
*https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
*https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/samba/var/profiles &lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/samba/etc/smb.conf&lt;br /&gt;
 read only = No&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
*login to the domain as administrator onto a windows 7 computer &lt;br /&gt;
*open up my computer and navigate to &amp;quot;\\servername&amp;quot; , ex. &amp;quot;\\samba4&amp;quot;&lt;br /&gt;
*Right Click on the folder and select properties&lt;br /&gt;
*Change security to allow Domain Administrators Full Control&lt;br /&gt;
*add Domain Users to Security with options, Traverse folder/execute file. List Folder/read data, Create folder/append data&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==SSSD==&lt;br /&gt;
 vim /etc/sssd/sssd.conf&lt;br /&gt;
 [domain/default]&lt;br /&gt;
 ldap_tls_reqcert = allow&lt;br /&gt;
 ldap_id_use_start_tls = True&lt;br /&gt;
 cache_credentials = True&lt;br /&gt;
 ldap_search_base = dc=domain,dc=edu&lt;br /&gt;
 krb5_realm = $REALM&lt;br /&gt;
 id_provider = ldap&lt;br /&gt;
 auth_provider = ldap&lt;br /&gt;
 chpass_provider = ldap&lt;br /&gt;
 ldap_uri = ldap://domain.edu&lt;br /&gt;
 ldap_tls_cacertdir = /etc/openldap/cacerts&lt;br /&gt;
 ldap_schema = rfc2307bis&lt;br /&gt;
 ldap_user_fullname = displayName&lt;br /&gt;
 ldap_user_search_base = ou=idmap,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_search_base = ou=Group,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_member = member&lt;br /&gt;
 ldap_group_nesting_level = 4&lt;br /&gt;
 ldap_tls_cacert = /etc/openldap/cacerts/cacert.pem&lt;br /&gt;
 ldap_tls_reqcert = demand&lt;br /&gt;
 ldap_default_bind_dn = cn=Manager,dc=domain,dc=edu&lt;br /&gt;
 ldap_default_authtok_type = password&lt;br /&gt;
 ldap_default_authtok = ******&lt;br /&gt;
 debug_level = 8&lt;br /&gt;
 [sssd]&lt;br /&gt;
 services = nss, pam&lt;br /&gt;
 config_file_version = 2&lt;br /&gt;
 domains = default&lt;br /&gt;
 [nss]  &lt;br /&gt;
&lt;br /&gt;
 [pam]&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2872</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2872"/>
		<updated>2016-02-04T23:11:54Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Adding Profile path to Samba */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.   &lt;br /&gt;
&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
Samba Ports needed here:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_port_usage&lt;br /&gt;
*settings(old?):&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few seconds apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
Samba wiki's:&lt;br /&gt;
*https://wiki.samba.org/index.php/User_home_drives&lt;br /&gt;
*https://wiki.samba.org/index.php/Shares_with_Windows_ACLs&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/samba/var/profiles &lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/samba/etc/smb.conf&lt;br /&gt;
 read only = No&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
*login to the domain as administrator onto a windows 7 computer &lt;br /&gt;
*open up my computer and navigate to &amp;quot;\\servername&amp;quot; , ex. &amp;quot;\\samba4&amp;quot;&lt;br /&gt;
*Right Click on the folder and select properties&lt;br /&gt;
*Change security to allow Domain Administrators Full Control&lt;br /&gt;
*add Domain Users to Security with options, Traverse folder/execute file. List Folder/read data, Create folder/append data&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==SSSD==&lt;br /&gt;
 vim /etc/sssd/sssd.conf&lt;br /&gt;
 [domain/default]&lt;br /&gt;
 ldap_tls_reqcert = allow&lt;br /&gt;
 ldap_id_use_start_tls = True&lt;br /&gt;
 cache_credentials = True&lt;br /&gt;
 ldap_search_base = dc=domain,dc=edu&lt;br /&gt;
 krb5_realm = $REALM&lt;br /&gt;
 id_provider = ldap&lt;br /&gt;
 auth_provider = ldap&lt;br /&gt;
 chpass_provider = ldap&lt;br /&gt;
 ldap_uri = ldap://domain.edu&lt;br /&gt;
 ldap_tls_cacertdir = /etc/openldap/cacerts&lt;br /&gt;
 ldap_schema = rfc2307bis&lt;br /&gt;
 ldap_user_fullname = displayName&lt;br /&gt;
 ldap_user_search_base = ou=idmap,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_search_base = ou=Group,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_member = member&lt;br /&gt;
 ldap_group_nesting_level = 4&lt;br /&gt;
 ldap_tls_cacert = /etc/openldap/cacerts/cacert.pem&lt;br /&gt;
 ldap_tls_reqcert = demand&lt;br /&gt;
 ldap_default_bind_dn = cn=Manager,dc=domain,dc=edu&lt;br /&gt;
 ldap_default_authtok_type = password&lt;br /&gt;
 ldap_default_authtok = ******&lt;br /&gt;
 debug_level = 8&lt;br /&gt;
 [sssd]&lt;br /&gt;
 services = nss, pam&lt;br /&gt;
 config_file_version = 2&lt;br /&gt;
 domains = default&lt;br /&gt;
 [nss]  &lt;br /&gt;
&lt;br /&gt;
 [pam]&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2871</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2871"/>
		<updated>2016-02-04T23:10:43Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Firewall */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.   &lt;br /&gt;
&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
Samba Ports needed here:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_port_usage&lt;br /&gt;
*settings(old?):&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few seconds apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/samba/var/profiles &lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/samba/etc/smb.conf&lt;br /&gt;
 read only = No&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
*login to the domain as administrator onto a windows 7 computer &lt;br /&gt;
*open up my computer and navigate to &amp;quot;\\servername&amp;quot; , ex. &amp;quot;\\samba4&amp;quot;&lt;br /&gt;
*Right Click on the folder and select properties&lt;br /&gt;
*Change security to allow Domain Administrators Full Control&lt;br /&gt;
*add Domain Users to Security with options, Traverse folder/execute file. List Folder/read data, Create folder/append data&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==SSSD==&lt;br /&gt;
 vim /etc/sssd/sssd.conf&lt;br /&gt;
 [domain/default]&lt;br /&gt;
 ldap_tls_reqcert = allow&lt;br /&gt;
 ldap_id_use_start_tls = True&lt;br /&gt;
 cache_credentials = True&lt;br /&gt;
 ldap_search_base = dc=domain,dc=edu&lt;br /&gt;
 krb5_realm = $REALM&lt;br /&gt;
 id_provider = ldap&lt;br /&gt;
 auth_provider = ldap&lt;br /&gt;
 chpass_provider = ldap&lt;br /&gt;
 ldap_uri = ldap://domain.edu&lt;br /&gt;
 ldap_tls_cacertdir = /etc/openldap/cacerts&lt;br /&gt;
 ldap_schema = rfc2307bis&lt;br /&gt;
 ldap_user_fullname = displayName&lt;br /&gt;
 ldap_user_search_base = ou=idmap,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_search_base = ou=Group,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_member = member&lt;br /&gt;
 ldap_group_nesting_level = 4&lt;br /&gt;
 ldap_tls_cacert = /etc/openldap/cacerts/cacert.pem&lt;br /&gt;
 ldap_tls_reqcert = demand&lt;br /&gt;
 ldap_default_bind_dn = cn=Manager,dc=domain,dc=edu&lt;br /&gt;
 ldap_default_authtok_type = password&lt;br /&gt;
 ldap_default_authtok = ******&lt;br /&gt;
 debug_level = 8&lt;br /&gt;
 [sssd]&lt;br /&gt;
 services = nss, pam&lt;br /&gt;
 config_file_version = 2&lt;br /&gt;
 domains = default&lt;br /&gt;
 [nss]  &lt;br /&gt;
&lt;br /&gt;
 [pam]&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2870</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2870"/>
		<updated>2016-02-04T23:04:57Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Install CentOS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.   &lt;br /&gt;
&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
*settings:&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few seconds apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/samba/var/profiles &lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/samba/etc/smb.conf&lt;br /&gt;
 read only = No&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
*login to the domain as administrator onto a windows 7 computer &lt;br /&gt;
*open up my computer and navigate to &amp;quot;\\servername&amp;quot; , ex. &amp;quot;\\samba4&amp;quot;&lt;br /&gt;
*Right Click on the folder and select properties&lt;br /&gt;
*Change security to allow Domain Administrators Full Control&lt;br /&gt;
*add Domain Users to Security with options, Traverse folder/execute file. List Folder/read data, Create folder/append data&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==SSSD==&lt;br /&gt;
 vim /etc/sssd/sssd.conf&lt;br /&gt;
 [domain/default]&lt;br /&gt;
 ldap_tls_reqcert = allow&lt;br /&gt;
 ldap_id_use_start_tls = True&lt;br /&gt;
 cache_credentials = True&lt;br /&gt;
 ldap_search_base = dc=domain,dc=edu&lt;br /&gt;
 krb5_realm = $REALM&lt;br /&gt;
 id_provider = ldap&lt;br /&gt;
 auth_provider = ldap&lt;br /&gt;
 chpass_provider = ldap&lt;br /&gt;
 ldap_uri = ldap://domain.edu&lt;br /&gt;
 ldap_tls_cacertdir = /etc/openldap/cacerts&lt;br /&gt;
 ldap_schema = rfc2307bis&lt;br /&gt;
 ldap_user_fullname = displayName&lt;br /&gt;
 ldap_user_search_base = ou=idmap,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_search_base = ou=Group,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_member = member&lt;br /&gt;
 ldap_group_nesting_level = 4&lt;br /&gt;
 ldap_tls_cacert = /etc/openldap/cacerts/cacert.pem&lt;br /&gt;
 ldap_tls_reqcert = demand&lt;br /&gt;
 ldap_default_bind_dn = cn=Manager,dc=domain,dc=edu&lt;br /&gt;
 ldap_default_authtok_type = password&lt;br /&gt;
 ldap_default_authtok = ******&lt;br /&gt;
 debug_level = 8&lt;br /&gt;
 [sssd]&lt;br /&gt;
 services = nss, pam&lt;br /&gt;
 config_file_version = 2&lt;br /&gt;
 domains = default&lt;br /&gt;
 [nss]  &lt;br /&gt;
&lt;br /&gt;
 [pam]&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2869</id>
		<title>AD Samba4</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4&amp;diff=2869"/>
		<updated>2016-02-04T23:04:39Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Install CentOS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4, such as DFS and others, will try and document what you can and can not accomplish at the moment with Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.12&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 6.5&lt;br /&gt;
&lt;br /&gt;
Will try and make this page as simple to recreate using the same environment, however if confused or have no idea where to begin I recommend heading over to the Samba Wiki pages and reading there How To's and Documentation:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO&lt;br /&gt;
*https://wiki.samba.org/index.php/User_Documentation&lt;br /&gt;
If still confused over anything I would recommend googling it, all of this I have found over the internet from different resources and will try and incorporate them into this wiki. For a complete list of all the references I found extremely useful see the bottom of this page.   &lt;br /&gt;
&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
Install a minimal install of CentOS 6.5, at time of writing can be downloaded here:&lt;br /&gt;
*http://mirrors.usc.edu/pub/linux/distributions/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso&lt;br /&gt;
If you prefer to use a gui or a full install go check out the CentOS mirrors list:&lt;br /&gt;
*http://isoredirect.centos.org/centos/6/isos/x86_64/&lt;br /&gt;
*I would not recommend using CentOS 7 as the install procedure, startup service, as well as packages are a bit different, that being said it is entirely possible to get Samba 4 working on CentOS 7, if I have time and am upgrading I may come back and add in the changes CentOS 7 requires.&lt;br /&gt;
*See here for CentOS 7: http://wiki.eri.ucsb.edu/stadm/AD_Samba4_Centos_7&lt;br /&gt;
&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
Here are the OS Requirements as listed by the Samba Team:&lt;br /&gt;
*https://wiki.samba.org/index.php/OS_Requirements&lt;br /&gt;
Basically for a working Active Directory on CentOS install it is required that your system support Extended File Attributes.&lt;br /&gt;
&lt;br /&gt;
Here are the packages I needed to install to build Samba 4, please note that all of these packages are probably not required and you are free to use the minimal list provided in the Samba Wiki, I have been trying to weed out most of the packages not needed and will be updating as I find extras, but as this is how a working setup was accomplished(with extra features not needed to just compile a basic Samba 4 server) I will leave this up for now:&lt;br /&gt;
  yum install gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
   readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
   zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
   setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
   libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
   popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
   libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
   glibc glibc-devel gcc libacl-devel krb5-server krb5-workstation krb5-libs pam_krb5 make gnutls-devel \&lt;br /&gt;
   openldap-devel openldap-clients openldap-servers openldap-servers-sql \&lt;br /&gt;
   openssl-devel bind bind-libs bind-utils libblkid-devel readline-devel gdb python-devel cups sqlite-devel \&lt;br /&gt;
   setroubleshoot-server popt-devel libxml2-devel libpcap-devel libidn-devel cups-devel ctdb-devel pam-devel gnutls-devel \&lt;br /&gt;
   krb5-server-ldap nss-pam-ldapd pam_ldap openssh-ldap python-ldap docbook-style-xsl vim wget&lt;br /&gt;
*Note: if not installing vim(why wouldn't you in the first place?) make sure to install perl(dependency for vim), ./configure will fail down below without perl&lt;br /&gt;
&lt;br /&gt;
*Here is a more minimal list to compile with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 &amp;gt;    readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 &amp;gt;    zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 &amp;gt;    setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 &amp;gt;    libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 &amp;gt;    popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 &amp;gt;    libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 &amp;gt;    keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 &amp;gt;    libxslt docbook-style-xsl openldap-devel pam-devel&lt;br /&gt;
&lt;br /&gt;
Once CentOS is installed, give it hostname as well as static IP Address, this can be done through DHCP or by manually editing CentOS network scripts&lt;br /&gt;
 vim /etc/sysconfig/network&lt;br /&gt;
*Edit &amp;quot;HOSTNAME=***&amp;quot; to say &amp;quot;HOSTNAME=samba&amp;quot; or whatever you want to name the server&lt;br /&gt;
*Manually edit or add network-scripts if not there&lt;br /&gt;
 cd /etc/sysconfig/network-scripts/&lt;br /&gt;
 vim ifcfg-eth0&lt;br /&gt;
*Make sure these options are included&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=**:**:**:**:**:**&lt;br /&gt;
 TYPE=ETHERNET&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 NM_CONTROLLED=yes&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
*For a static IP Address, go look at an example here: https://gist.github.com/fernandoaleman/2172388 (or just google how to give centos a static ip)&lt;br /&gt;
*Restart the network service&lt;br /&gt;
 service network restart&lt;br /&gt;
For the purpose of saving time I have setup CentOS with selinux disabled, check to see this allowed by your Organization/Company before disabling selinux(this could be potentially dangerous depending on your network setup). Google Samba 4 selinux or visit the Samba Wiki here: https://wiki.samba.org/index.php/Samba_AD_DC_access_control_settings , if time allows I may come back and try to incorporate selinux into this wiki&lt;br /&gt;
*To disable selinux&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*Change &amp;quot;SELINUX=enforcing&amp;quot; to &amp;quot;SELINUX=disabled&amp;quot;&lt;br /&gt;
*Restart the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
Decide what version of Samba 4 you would like to use, if your demoing or a developer consider using the newer developer version. Note: May have bugs and is not suitable in a production environment&lt;br /&gt;
*For developers:&lt;br /&gt;
*install git&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 git clone git://git.samba.org/samba.git ~/samba-master&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 09-26-14):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.12.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.12.tar.gz&lt;br /&gt;
*Build the samba install, replace samba-master with samba-[Version#]&lt;br /&gt;
 cd ~/samba-master&lt;br /&gt;
 ./configure --enable-debug --enable-selftest&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
==Creating Samba Service==&lt;br /&gt;
Samba does not come with a provided service script, however it is easy to just copy a script from a service that is already implemented, we will use rdisc and modify it for starting and stopping samba.&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 cp rdisc samba&lt;br /&gt;
 vim samba&lt;br /&gt;
 :%s/rdisc/samba/g&lt;br /&gt;
 :wq&lt;br /&gt;
*Change daemon location from /sbin/samba to /usr/local/samba/sbin/samba, as well as killproc location&lt;br /&gt;
*Delete RDISCOPT variable, remove usage from daemon command&lt;br /&gt;
*Change what gets echoed to the screen&lt;br /&gt;
Or after reviewing to make sure it work with your system, you can download the scripts here: https://github.com/t-ali/samba4_scripts/blob/master/samba&lt;br /&gt;
&lt;br /&gt;
Move the file samba to /etc/init.d/&lt;br /&gt;
*Portreserve gets installed as a dependency, nothing wrong with it however it only gives slapd access to port 636 which is required for samba ldap service, to get around this remove this file used by portreserve&lt;br /&gt;
 rm /etc/portreserve/slapd&lt;br /&gt;
*You may have to restart your server to get portreserve to release port 636&lt;br /&gt;
&lt;br /&gt;
==Enabling Samba 4 as DC==&lt;br /&gt;
*Add samba path to $PATH, this only works for bash&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
*Run command &lt;br /&gt;
 /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
*the domain-provision tool should pick all defaults automatically, however they can be changed to your liking&lt;br /&gt;
*it is your choice to decide what kind of DNS you would like to use, you can configure your own bind DNS server and manage it yourself for the domain(not going to be covered here) or you can forward requests to your DNS server and have Samba 4 deal with the Windows DNS entries(Samba 4 will be a DNS forwarder). Feel free to use your own DNS server to forward requests to, for the sake of testing I am just putting in googles public DNS address 8.8.8.8&lt;br /&gt;
 [root@dumbo var]# /usr/local/samba/bin/samba-tool domain provision&lt;br /&gt;
 Realm: AD1.domain.edu&lt;br /&gt;
  Domain [AD1]:&lt;br /&gt;
  Server Role (dc, member, standalone) [dc]:&lt;br /&gt;
  DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:&lt;br /&gt;
  DNS forwarder IP address (write 'none' to disable forwarding) [8.8.8.8]:&lt;br /&gt;
 Administrator password:&lt;br /&gt;
 Retype password:&lt;br /&gt;
 Looking up IPv4 addresses&lt;br /&gt;
 Looking up IPv6 addresses&lt;br /&gt;
 No IPv6 address will be assigned&lt;br /&gt;
 Setting up share.ldb&lt;br /&gt;
 Setting up secrets.ldb&lt;br /&gt;
 Setting up the registry&lt;br /&gt;
 Setting up the privileges database&lt;br /&gt;
 Setting up idmap db&lt;br /&gt;
 Setting up SAM db&lt;br /&gt;
 Setting up sam.ldb partitions and settings&lt;br /&gt;
 Setting up sam.ldb rootDSE&lt;br /&gt;
 Pre-loading the Samba 4 and AD schema&lt;br /&gt;
 Adding DomainDN: DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Adding configuration container&lt;br /&gt;
 Setting up sam.ldb schema&lt;br /&gt;
 Setting up sam.ldb configuration data&lt;br /&gt;
 Setting up display specifiers&lt;br /&gt;
 Modifying display specifiers&lt;br /&gt;
 Adding users container&lt;br /&gt;
 Modifying users container&lt;br /&gt;
 Adding computers container&lt;br /&gt;
 Modifying computers container&lt;br /&gt;
 Setting up sam.ldb data&lt;br /&gt;
 Setting up well known security principals&lt;br /&gt;
 Setting up sam.ldb users and groups&lt;br /&gt;
 Setting up self join&lt;br /&gt;
 Adding DNS accounts&lt;br /&gt;
 Creating CN=MicrosoftDNS,CN=System,DC=ad1,DC=domain,DC=edu&lt;br /&gt;
 Creating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Populating DomainDnsZones and ForestDnsZones partitions&lt;br /&gt;
 Setting up sam.ldb rootDSE marking as synchronized&lt;br /&gt;
 Fixing provision GUIDs&lt;br /&gt;
 A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf&lt;br /&gt;
 Once the above files are installed, your Samba4 server will be ready to use&lt;br /&gt;
 Server Role:           active directory domain controller&lt;br /&gt;
 Hostname:              dumbo&lt;br /&gt;
 NetBIOS Domain:        AD1&lt;br /&gt;
 DNS Domain:            ad1.domain.edu&lt;br /&gt;
 DOMAIN SID:            S-1-5-21-3942629588-2438417362-1542489463&lt;br /&gt;
After provisioning a kerberos file has been created that is usable with samba, make a backup of current kerberos configuration and copy the generated file to /etc/krb5.conf &lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf &lt;br /&gt;
*your krb5.conf file should look like&lt;br /&gt;
 [libdefaults]&lt;br /&gt;
 	default_realm = AD1.DOMAIN.EDU&lt;br /&gt;
 	dns_lookup_realm = false&lt;br /&gt;
 	dns_lookup_kdc = true&lt;br /&gt;
Now we can fnially start the samba service, if you tried starting it earlier it most likely failed to start, you can check the status by:&lt;br /&gt;
 service samba status&lt;br /&gt;
Now that we have everything in place start the samba service:&lt;br /&gt;
 service samba start&lt;br /&gt;
We can check a couple ways to make sure samba is up and running, go check out the log files located at&lt;br /&gt;
 cd /usr/local/samba/var/&lt;br /&gt;
 tail log.samba&lt;br /&gt;
 tail log.smbd&lt;br /&gt;
Usually any errors will appear at the end of log.smbd telling you smbd did not start, a working output would look like&lt;br /&gt;
 [2014/09/26 16:32:48,  0] ../source3/smbd/server.c:1189(main)&lt;br /&gt;
   smbd version 4.1.12 started.&lt;br /&gt;
   Copyright Andrew Tridgell and the Samba Team 1992-2013&lt;br /&gt;
 [2014/09/26 16:32:49.031941,  0] ../lib/util/become_daemon.c:136(daemon_ready)&lt;br /&gt;
And one more way just to check for the paranoid:&lt;br /&gt;
 ps aux | grep -v grep | grep samba&lt;br /&gt;
Output should spit out a bunch of running processes&lt;br /&gt;
 [root@dumbo var]# ps aux | grep -v grep | grep samba&lt;br /&gt;
 root      1626  0.0  2.3 538864 44768 ?        Ss   10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1628  0.0  1.6 538864 31916 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1629  0.0  1.6 538864 32676 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1630  0.0  1.7 538864 33544 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1631  0.0  1.6 538864 31884 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1632  0.0  2.4 587472 46564 ?        Ss   10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
 root      1633  0.0  1.7 538864 33880 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1634  0.0  1.6 538864 32472 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1635  0.0  1.8 545120 36128 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1636  0.0  1.7 538864 33324 ?        S    10:56   0:11 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1637  0.0  1.7 541692 33180 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1638  0.0  1.6 538864 31996 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1639  0.0  2.1 539024 41976 ?        S    10:56   0:04 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1640  0.0  1.7 538864 33012 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1641  0.0  1.8 541388 35248 ?        S    10:56   0:00 /usr/local/samba/sbin/samba&lt;br /&gt;
 root      1644  0.0  1.7 587996 32820 ?        S    10:56   0:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground&lt;br /&gt;
Once you have verified samba has started without any errors you should add it to the startup&lt;br /&gt;
 chkconfig samba on&lt;br /&gt;
*samba version as well as samba client version can be checked using the following commands&lt;br /&gt;
 /usr/local/samba/sbin/samba -V&lt;br /&gt;
 /usr/local/samba/bin/smbclient --version&lt;br /&gt;
&lt;br /&gt;
==Configuring DNS==&lt;br /&gt;
*DNS forwarding was set up on the domain provisioning using the samba-tool script&lt;br /&gt;
 cat /usr/local/samba/etc/smb.conf&lt;br /&gt;
*there should be a line under &amp;quot;[global]&amp;quot; that says &amp;quot;dns forwarder = ***.***.***.***&amp;quot;, if not it was not enabled during domain provisioning&lt;br /&gt;
The server that samba was installed on should have itself as a DNS server(if using DNS forwarding, if not you must add in all the entires manually into your own DNS server, listed further below)&lt;br /&gt;
*Edit your network script to include itself as a DNS server &lt;br /&gt;
 vim /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
*Add in the line&lt;br /&gt;
 DNS1=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
*Restart the network service so that the correct DNS is now used&lt;br /&gt;
 service network restart&lt;br /&gt;
*Check to see server sees itself as a DNS server&lt;br /&gt;
 cat /etc/resolv.conf&lt;br /&gt;
*There should be a line that says &lt;br /&gt;
 nameserver 127.0.0.1 &lt;br /&gt;
*Test that the correct DNS entries are in your samba server and that you can resolve them(change &amp;quot;ad1.domain.edu&amp;quot; to the name of your domain and &amp;quot;dumbo&amp;quot; to your hostname)&lt;br /&gt;
 host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 host -t A dumbo.ad1.domain.edu&lt;br /&gt;
*Should return:&lt;br /&gt;
 [root@dumbo var]# host -t SRV _ldap._tcp.ad1.domain.edu&lt;br /&gt;
 _ldap._tcp.ad1.domain.edu has SRV record 0 100 389 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t SRV _kerberos._udp.ad1.domain.edu&lt;br /&gt;
 _kerberos._udp.ad1.domain.edu has SRV record 0 100 88 dumbo.ad1.domain.edu.&lt;br /&gt;
 [root@dumbo var]# host -t A dumbo.ad1.domain.edu&lt;br /&gt;
 dumbo.ad1.domain.edu has address 10.0.2.15&lt;br /&gt;
*If the test did not produce those outputs DNS has not been configured properly&lt;br /&gt;
*These are the entries required if you are going to do this manually in your DNS server, or script it, or use samba_dnsupdate script&lt;br /&gt;
*you can see these values at /usr/local/samba/private/dns_update_list&lt;br /&gt;
 cat /usr/local/samba/private/dns_update_list&lt;br /&gt;
 # this is a list of DNS entries which will be put into DNS using&lt;br /&gt;
 # dynamic DNS update. It is processed by the samba_dnsupdate script&lt;br /&gt;
 A                      ${HOSTNAME}                                           $IP&lt;br /&gt;
 AAAA                   ${HOSTNAME}                                           $IP&lt;br /&gt;
 &lt;br /&gt;
 # RW domain controller&lt;br /&gt;
 ${IF_RWDC}A            ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}AAAA         ${DNSDOMAIN}                                          $IP&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DNSDOMAIN}                               ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.dc._msdcs.${DNSDOMAIN}                     ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _ldap._tcp.${DOMAINGUID}.domains._msdcs.${DNSFOREST}  ${HOSTNAME} 389&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._udp.${DNSDOMAIN}                           ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kerberos._tcp.dc._msdcs.${DNSDOMAIN}                 ${HOSTNAME} 88&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._tcp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 ${IF_RWDC}SRV          _kpasswd._udp.${DNSDOMAIN}                            ${HOSTNAME} 464&lt;br /&gt;
 # RW and RO domain controller&lt;br /&gt;
 ${IF_DC}CNAME          ${NTDSGUID}._msdcs.${DNSFOREST}                       ${HOSTNAME}&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _ldap._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}      ${HOSTNAME} 389&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.${DNSDOMAIN}            ${HOSTNAME} 88&lt;br /&gt;
 ${IF_DC}SRV            _kerberos._tcp.${SITE}._sites.dc._msdcs.${DNSDOMAIN}  ${HOSTNAME} 88&lt;br /&gt;
 &lt;br /&gt;
 # The PDC emulator&lt;br /&gt;
 ${IF_PDC}SRV           _ldap._tcp.pdc._msdcs.${DNSDOMAIN}                    ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW GC servers&lt;br /&gt;
 ${IF_RWGC}A            gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}AAAA         gc._msdcs.${DNSFOREST}                                $IP&lt;br /&gt;
 ${IF_RWGC}SRV          _gc._tcp.${DNSFOREST}                                 ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_RWGC}SRV          _ldap._tcp.gc._msdcs.${DNSFOREST}                     ${HOSTNAME} 3268&lt;br /&gt;
 # RW and RO GC servers&lt;br /&gt;
 ${IF_GC}SRV            _gc._tcp.${SITE}._sites.${DNSFOREST}                  ${HOSTNAME} 3268&lt;br /&gt;
 ${IF_GC}SRV            _ldap._tcp.${SITE}._sites.gc._msdcs.${DNSFOREST}      ${HOSTNAME} 3268&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}A    DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}AAAA DomainDnsZones.${DNSDOMAIN}                           $IP&lt;br /&gt;
 ${IF_RWDNS_DOMAIN}SRV  _ldap._tcp.DomainDnsZones.${DNSDOMAIN}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_DOMAIN}SRV    _ldap._tcp.${SITE}._sites.DomainDnsZones.${DNSDOMAIN} ${HOSTNAME} 389&lt;br /&gt;
 &lt;br /&gt;
 # RW DNS servers&lt;br /&gt;
 ${IF_RWDNS_FOREST}A    ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}AAAA ForestDnsZones.${DNSFOREST}                           $IP&lt;br /&gt;
 ${IF_RWDNS_FOREST}SRV  _ldap._tcp.ForestDnsZones.${DNSFOREST}                ${HOSTNAME} 389&lt;br /&gt;
 # RW and RO DNS servers&lt;br /&gt;
 ${IF_DNS_FOREST}SRV    _ldap._tcp.${SITE}._sites.ForestDnsZones.${DNSFOREST} ${HOSTNAME} 389&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
*settings:&lt;br /&gt;
 -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 139 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 88 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 389 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 1024 -j ACCEPT&lt;br /&gt;
  &lt;br /&gt;
 -A INPUT -p tcp --dport 636 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3268 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 3269 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 445 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 25 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 135 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 5722 -j ACCEPT&lt;br /&gt;
 -A INPUT -p udp --dport 464 -j ACCEPT&lt;br /&gt;
 -A INPUT -p tcp --dport 137 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
==Kerberos==&lt;br /&gt;
*make a backup of original kerberos file and replace it with the copy generated by samba&lt;br /&gt;
 mv /etc/krb5.conf /etc/krb5.conf.bak&lt;br /&gt;
 cp /usr/local/samba/share/setup/krb5.conf /etc/krb5.conf&lt;br /&gt;
*edit the new krb5.conf file and change the ${REALM} variable to the realm selected during domain provisioning, ALL CAPS&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
*test Kerberos using the kinit command &lt;br /&gt;
 kinit administrator@MYDOMAIN.COM&lt;br /&gt;
*if Kerberos is working you will be asked for your password&lt;br /&gt;
*verify that it is working by running klist, output should look something along the lines of&lt;br /&gt;
 Ticket cache: FILE:/tmp/krb5cc_0&lt;br /&gt;
 Default principal: administrator@MYDOMAIN.COM&lt;br /&gt;
 &lt;br /&gt;
 Valid starting Expires Service principal&lt;br /&gt;
 07/25/13 15:23:33 07/26/13 1:23:33 krbtgt/MYDOMAIN.COM@MYDOMAIN.COM&lt;br /&gt;
 renew until 07/26/13 15:23:31&lt;br /&gt;
&lt;br /&gt;
==NTP==&lt;br /&gt;
*Check this guide for installing and debugging NTP for domain joined machines:&lt;br /&gt;
**http://wiki.eri.ucsb.edu/stadm/Samba4_NTP&lt;br /&gt;
*Quick setup&lt;br /&gt;
 yum install ntp&lt;br /&gt;
 chown root:ntp /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
 chmod 750 /usr/local/samba/var/lib/ntp_signd&lt;br /&gt;
*Edit&lt;br /&gt;
 vim /etc/ntp.conf&lt;br /&gt;
*add&lt;br /&gt;
 restrict default mssntp kod nomodify notrap nopeer noquery&lt;br /&gt;
 ntpsigndsocket  /usr/local/samba/var/lib/ntp_signd/&lt;br /&gt;
*add to startup and start&lt;br /&gt;
 systemctl enable ntpd&lt;br /&gt;
 systemctl start ntp&lt;br /&gt;
*or(Centos 6/SysVinit)&lt;br /&gt;
 chkconfig ntpd on&lt;br /&gt;
 service ntpd start&lt;br /&gt;
&lt;br /&gt;
=Windows Domain=&lt;br /&gt;
==Add Windows computer to domain==&lt;br /&gt;
*manually edit network settings to point DNS to samba4 server&lt;br /&gt;
*assign static ip so there are no problems with joining computers to domain&lt;br /&gt;
*ping samba4 server at ip address to verify you can see it&lt;br /&gt;
 ping 128.***.***.****&lt;br /&gt;
*ping FQDN to verify DNS is working&lt;br /&gt;
 ping samba4.mydomain.com&lt;br /&gt;
*should get replies form both verifying that you can communicate with server and that DNS is functioning &lt;br /&gt;
*run the date command in your server&lt;br /&gt;
 date&lt;br /&gt;
*Change the date and time on Windows Computer so that it is within a few seconds of the server, Kerberos requires the times between computers be no more than a few seconds apart&lt;br /&gt;
*Right click on &amp;quot;My Computer&amp;quot; and click &amp;quot;Properties&amp;quot;&lt;br /&gt;
*Under &amp;quot;Computer name, domain, and workgroup settings&amp;quot; click change settings&lt;br /&gt;
*Under &amp;quot;Member of&amp;quot; check &amp;quot;Domain&amp;quot;&lt;br /&gt;
*Type in the name of your domain in full uppercase letters, ex. &lt;br /&gt;
**MYDOMAIN.COM&lt;br /&gt;
*When asked enter in the username and password for the Administrator created during the samba-tool domain provisioning&lt;br /&gt;
*Once you have joined the domain restart the computer and you can now log in to the domain&lt;br /&gt;
&lt;br /&gt;
==Adding Profile path to Samba==&lt;br /&gt;
*make a folder where the profiles will be stored&lt;br /&gt;
 mkdir /usr/local/samba/var/profiles &lt;br /&gt;
*Add the following to smb.conf to inlcude that location&lt;br /&gt;
 vim /usr/local/samba/etc/smb.conf&lt;br /&gt;
*insert the follwing&lt;br /&gt;
 [profiles]&lt;br /&gt;
 path = /usr/local/samba/etc/smb.conf&lt;br /&gt;
 read only = No&lt;br /&gt;
*restart samba&lt;br /&gt;
 /usr/local/samba/bin/smbcontrol all reload-config&lt;br /&gt;
*once restarted check the shares on your samba server, profiles should appear under there&lt;br /&gt;
 smbclient -L localhost -U%&lt;br /&gt;
&lt;br /&gt;
==Change Security on Profiles folder==&lt;br /&gt;
*login to the domain as administrator onto a windows 7 computer &lt;br /&gt;
*open up my computer and navigate to &amp;quot;\\servername&amp;quot; , ex. &amp;quot;\\samba4&amp;quot;&lt;br /&gt;
*Right Click on the folder and select properties&lt;br /&gt;
*Change security to allow Domain Administrators Full Control&lt;br /&gt;
*add Domain Users to Security with options, Traverse folder/execute file. List Folder/read data, Create folder/append data&lt;br /&gt;
==Install RSAT==&lt;br /&gt;
*Download Remote Server Administration Tool from the microsoft website, http://www.microsoft.com/en-us/download/details.aspx?id=7887&lt;br /&gt;
*Install, Once installed open up control panel and then open up programs, then programs and features &lt;br /&gt;
*on the left pane click &amp;quot;Turn Windows features on or off&amp;quot;&lt;br /&gt;
*Select all under Remote Server Administration Tool, then click okay&lt;br /&gt;
==Adding User and profile path==&lt;br /&gt;
*From a windows computer with RSAT installed run: dsa.msc&lt;br /&gt;
*create a new user and edit its properties to include a profile path of &amp;quot;\\servername\profiles\%USERNAME%&amp;quot;&lt;br /&gt;
*then run: gpupdate /force&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
*If you're having Group Policy Issues you can view what has been applied by gpresult&lt;br /&gt;
*From command line run:&lt;br /&gt;
 gpresult /H filename.html&lt;br /&gt;
*or if you only want Computer Configuration(must be run as an administrator)&lt;br /&gt;
 gpresult /SCOPE COMPUTER /H filename.html&lt;br /&gt;
*Login with new user on domain and roaming profile will be created under /usr/local/samba/var/profiles on the server&lt;br /&gt;
&lt;br /&gt;
==Folder Security==&lt;br /&gt;
*create a share for where users folder redirections will go, want on a NFS, demoing on local drive&lt;br /&gt;
 [users]&lt;br /&gt;
        path = usr/local/samba/var/data/users&lt;br /&gt;
        comment = temp user folders for folder redirection, move to NFS&lt;br /&gt;
        read only = No&lt;br /&gt;
*make the folder or have the NFS mouted&lt;br /&gt;
 mkdir -p usr/local/samba/var/data/users&lt;br /&gt;
 chown root:3000000 usr/local/samba/var/data/users&lt;br /&gt;
 chmod 755 usr/local/samba/var/data/users&lt;br /&gt;
*login into windows computer using a domain administrator to change permissions on users folder&lt;br /&gt;
*navigate to users folder on windows computer \\domainame.edu&lt;br /&gt;
*right click on users folder and select properties, go to security tab, click on advanced, click change permissions&lt;br /&gt;
*remove all current permissions, add new permissions making sure &amp;quot;Include inheritable permissions from the object's parents&amp;quot; is NOT checked  &lt;br /&gt;
*add:&lt;br /&gt;
**Administrator: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**Domain Admins: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**SYSTEM: Full Control : This Folder, Subfolder, and Files&lt;br /&gt;
**CREATOR OWNER: Full Control : Subfolder, and Files&lt;br /&gt;
**Authenticated Users: Traverse Folder/Execute FIle, List Folder/Read Data, Create Files/Write Data, Create Folders/Append Data, Change Permissions: This Folder Only&lt;br /&gt;
*restart service and check that settings stay&lt;br /&gt;
*using getfacl &lt;br /&gt;
 getfacl /data/users&lt;br /&gt;
*returns&lt;br /&gt;
 # file: users&lt;br /&gt;
 # owner: root&lt;br /&gt;
 # group: root&lt;br /&gt;
 user::rwx&lt;br /&gt;
 user:root:rwx&lt;br /&gt;
 group::---&lt;br /&gt;
 group:root:---&lt;br /&gt;
 group:3000002:rwx&lt;br /&gt;
 group:3000003:rwx&lt;br /&gt;
 group:3000008:rwx&lt;br /&gt;
 mask::rwx&lt;br /&gt;
 other::---&lt;br /&gt;
 default:user::rwx&lt;br /&gt;
 default:user:root:rwx&lt;br /&gt;
 default:group::---&lt;br /&gt;
 default:group:root:---&lt;br /&gt;
 default:group:3000002:rwx&lt;br /&gt;
 default:group:3000008:rwx&lt;br /&gt;
 default:mask::rwx&lt;br /&gt;
 default:other::---&lt;br /&gt;
==Folder Redirection with GPO==&lt;br /&gt;
*Download admx files for windows 7/2008 and place them in \\mydomain.edu\sysvol\domainname.edu\policies\PolicyDefinitions&lt;br /&gt;
*service samba restart&lt;br /&gt;
*Create OU in AD and add a couple users&lt;br /&gt;
*Open up Group Policy Management&lt;br /&gt;
*Do not edit default domain policy, instead right click on the OU, Create GPO and link to OU&lt;br /&gt;
*edit linked GPO&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Folder Redirection&lt;br /&gt;
*Click each folder and change setting under &amp;quot;Target&amp;quot; tab to:&lt;br /&gt;
**Setting: Basic - Redirect everyone's folder to the same location&lt;br /&gt;
**Target Folder Location: Create a folder for each user under the root path&lt;br /&gt;
**Root path:\\MYDOMAIN.EDU\users &lt;br /&gt;
*under the &amp;quot;Settings&amp;quot; tab&lt;br /&gt;
**Uncheck &amp;quot;Grant the user exclusive rights to (name_of_folder)&amp;quot;&lt;br /&gt;
**under policy removal: Leave the folder in the new location when policy is removed should remain checked&lt;br /&gt;
*Since folder redirection windows will ask for conformation every time you try and open a shortcut because they are stored on NFS&lt;br /&gt;
*Go to User Configuration =&amp;gt; Policies =&amp;gt; Windows Settings =&amp;gt; Internet Explorer Maintenance =&amp;gt; Security&lt;br /&gt;
**NOTE!!!: This can only be done from a Windows 7 Machine running RSAT, server 2012 and Windows 8 deprecated this feature&lt;br /&gt;
**reference:https://social.technet.microsoft.com/Forums/windowsserver/en-US/1f6a0d43-e81f-4038-88f6-75d8921fdf82/missing-group-policy-internet-explorer-maintenance &lt;br /&gt;
*Double Click Security Zones and Content Ratings&lt;br /&gt;
*A windows may pop up before you can edit settings click &amp;quot;continue&amp;quot;&lt;br /&gt;
*click modify settings, click on Local intranet, click Sites, click Advanced&lt;br /&gt;
*add:&lt;br /&gt;
 file://mydomain.edu&lt;br /&gt;
*click, close, OK, OK, and Apply&lt;br /&gt;
*Configuring Automatic Resolution Policy(when sync conflicts rise keep the last modified file)  &lt;br /&gt;
*Navigate to  Computer Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Registry&lt;br /&gt;
*create a new registry item&lt;br /&gt;
*add: Software\Microsoft\Windows\CurrentVersion\NetCache\SyncConflictHandling :to the key path&lt;br /&gt;
*in the UNC path add the share you want to Auto resolve conflicts with, \\DOMAIN\users&lt;br /&gt;
*set Value Data to 4&lt;br /&gt;
**0-7: &lt;br /&gt;
***1:Keep the local state. This overwrites the remote copy with the local copy's contents. If the local copy was deleted, this deletes the remote copy on the server.&lt;br /&gt;
***2:Keep the remote state. This overwrites the local copy with the remote copy's contents. If the remote copy was deleted, this deletes the local copy in the Offline Files cache.&lt;br /&gt;
***4:Retains the state of the latest operation as determined by last-change times of the items in conflict. If the local item was deleted, the time of deletion is used for comparison.&lt;br /&gt;
*save and apply&lt;br /&gt;
&lt;br /&gt;
==Map a Network Drive with GPO==&lt;br /&gt;
*Go to User Configuration =&amp;gt; Preferences =&amp;gt; Windows Settings =&amp;gt; Drive Maps&lt;br /&gt;
*Create new mapped drive with:&lt;br /&gt;
 Action:Create&lt;br /&gt;
 Location: \\mydomainname.edu\folder\location&lt;br /&gt;
 Reconnect:Checked&lt;br /&gt;
 Use:&amp;quot;*&amp;quot; (pick any drive letter)&lt;br /&gt;
 Hide/Show this drive:Show this Drive&lt;br /&gt;
 Hide/Show all drives:No Change&lt;br /&gt;
*click Okay &lt;br /&gt;
*samba must be restarted for GPO to take effect&lt;br /&gt;
*make sure all the right ports are open on your firewall or mapped drive may not connect, tcp 137, udp 137 etc..&lt;br /&gt;
&lt;br /&gt;
==Windows Update GPO==&lt;br /&gt;
*Download ADM files from Microsoft, http://www.microsoft.com/en-us/download/details.aspx?id=18664&lt;br /&gt;
*Install when asked, navigate to where it installed the ADM files. Usually C:\Program Files(x86)\Microsoft Group Policy\Windows Server...\...&lt;br /&gt;
*copy only wuau.adm to \\mydomain.edu\sysvol\mydomain.edu\Policies\PolicyDefinitions\&lt;br /&gt;
*Edit GPO&lt;br /&gt;
*Go to Computer Configuration =&amp;gt; Policies =&amp;gt; Administrative Templates =&amp;gt; Windows Components =&amp;gt; Windows Update&lt;br /&gt;
*still testing, enable the following&lt;br /&gt;
 Configure Automatic Updates: Enabled: Auto Download and Schedule Install: Every Day: 17:00&lt;br /&gt;
 Specify intranet Microsoft update service location: Enabled: http://servername:port, http://servername:port&lt;br /&gt;
 Automatic Updates Detection Frequency: enabled 12 hours&lt;br /&gt;
 Allow non administrators to receive update notifications : enabled&lt;br /&gt;
 Allow Automatic Updates immediate installation: Enabled&lt;br /&gt;
 No auto-restart with logged on user for scheduled automatic updates installations: Enabled&lt;br /&gt;
 Reschedule Automatic Updates scheduled installations: Enabled: 10 minutes&lt;br /&gt;
 Enable clients-de targeting: Enabled or Disabled, can be used to organize wsus better&lt;br /&gt;
 Allow signed updates from an intranet Microsoft update service location: enabled&lt;br /&gt;
&lt;br /&gt;
==SSSD==&lt;br /&gt;
 vim /etc/sssd/sssd.conf&lt;br /&gt;
 [domain/default]&lt;br /&gt;
 ldap_tls_reqcert = allow&lt;br /&gt;
 ldap_id_use_start_tls = True&lt;br /&gt;
 cache_credentials = True&lt;br /&gt;
 ldap_search_base = dc=domain,dc=edu&lt;br /&gt;
 krb5_realm = $REALM&lt;br /&gt;
 id_provider = ldap&lt;br /&gt;
 auth_provider = ldap&lt;br /&gt;
 chpass_provider = ldap&lt;br /&gt;
 ldap_uri = ldap://domain.edu&lt;br /&gt;
 ldap_tls_cacertdir = /etc/openldap/cacerts&lt;br /&gt;
 ldap_schema = rfc2307bis&lt;br /&gt;
 ldap_user_fullname = displayName&lt;br /&gt;
 ldap_user_search_base = ou=idmap,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_search_base = ou=Group,dc=domain,dc=edu&lt;br /&gt;
 ldap_group_member = member&lt;br /&gt;
 ldap_group_nesting_level = 4&lt;br /&gt;
 ldap_tls_cacert = /etc/openldap/cacerts/cacert.pem&lt;br /&gt;
 ldap_tls_reqcert = demand&lt;br /&gt;
 ldap_default_bind_dn = cn=Manager,dc=domain,dc=edu&lt;br /&gt;
 ldap_default_authtok_type = password&lt;br /&gt;
 ldap_default_authtok = ******&lt;br /&gt;
 debug_level = 8&lt;br /&gt;
 [sssd]&lt;br /&gt;
 services = nss, pam&lt;br /&gt;
 config_file_version = 2&lt;br /&gt;
 domains = default&lt;br /&gt;
 [nss]  &lt;br /&gt;
&lt;br /&gt;
 [pam]&lt;br /&gt;
&lt;br /&gt;
==ACL==&lt;br /&gt;
*set privileges&lt;br /&gt;
 net rpc rights grant 'Domain\Domain Admins' SeDiskOperatorPrivilege -Uadministrator&lt;br /&gt;
*view privileges&lt;br /&gt;
 net rpc rights list accounts -Uadministrator&lt;br /&gt;
*https://wiki.samba.org/index.php/Setup_and_configure_file_shares&lt;br /&gt;
*http://manpages.ubuntu.com/manpages/lucid/man1/setfacl.1.html&lt;br /&gt;
*http://www.linuxtopia.org/online_books/network_administration_guides/samba_reference_guide/23_AccessControls_25.html&lt;br /&gt;
*http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fsfacl.htm&lt;br /&gt;
*add group acl to folder or file&lt;br /&gt;
 setfacl -m &amp;quot;g:groupname:permissions&amp;quot; folder&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Access_Control_Lists&lt;br /&gt;
*get and set acls(x is location you want acls from, y is location you want acls to)&lt;br /&gt;
 getfacl x | setfacl -R –-set-file=- y&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
*after a yum update portreserve may have been updated and interferes with samba&lt;br /&gt;
*holds a lock on port 636 for slapd, samba provides an ldap service on 636 so slapd cannot hold it&lt;br /&gt;
*go to /etc/portreserve and remove the slapd file, restart server, portreserve will not hold lock in 636 anymore and samba can use it&lt;br /&gt;
 cd /etc/portreserve&lt;br /&gt;
 rm slapd&lt;br /&gt;
*deleting regedit user profile&lt;br /&gt;
http://social.technet.microsoft.com/wiki/contents/articles/13895.how-to-remove-a-corrupted-user-profile-from-the-registry.aspx&lt;br /&gt;
*Network level Authentication GPO&lt;br /&gt;
http://trekker.net/archives/group-policy-quick-tip-enable-remote-desktop-network-level-authentication/&lt;br /&gt;
&lt;br /&gt;
==ID Mapping/Group Mapping==&lt;br /&gt;
*https://wiki.samba.org/index.php/Adding_users_with_samba_tool&lt;br /&gt;
*http://linuxcostablanca.blogspot.com/2012/02/samba-4-posix-domain-user.html&lt;br /&gt;
==Extending Schema for UIDs==&lt;br /&gt;
*https://wiki.samba.org/index.php/Using_RFC2307_on_a_Samba_DC&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba_AD_Schema_Extenstions&lt;br /&gt;
&lt;br /&gt;
==save==&lt;br /&gt;
http://pig.made-it.com/samba-ldap-member.html&lt;br /&gt;
http://doub.home.xs4all.nl/samba-ldap/index.html&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#sdcsdmldap&lt;br /&gt;
http://www.samba.org/samba/docs/man/Samba-Guide/unixclients.html#ch9-sdmnss&lt;br /&gt;
https://wiki.samba.org/index.php/Samba4/Domain_Member&lt;br /&gt;
http://directory.fedoraproject.org/wiki/Howto:Samba&lt;br /&gt;
http://ptgmedia.pearsoncmg.com/images/013188221X/downloads/013188221X_book.pdf&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*http://www.alexwyn.com/computer-tips/centos-samba4-active-directory-domain-controller&lt;br /&gt;
*http://www.golinuxhub.com/2012/08/create-roaming-profiles-in-samba4.html&lt;br /&gt;
*http://opentodo.net/2013/01/samba4-as-ad-domain-controller-on-centos-6/&lt;br /&gt;
*http://wiki.samba.org/index.php/Samba_%26_Windows_Profiles&lt;br /&gt;
*http://clintboessen.blogspot.com/2012/08/open-file-security-warning.html&lt;br /&gt;
*http://stealthpuppy.com/configuring-an-automatic-resolution-policy-for-offline-files-in-windows-7/&lt;br /&gt;
*http://support.microsoft.com/kb/2189014&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch07.html&lt;br /&gt;
*https://www.samba.org/samba/docs/using_samba/ch08.html&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4_Centos_7&amp;diff=2868</id>
		<title>AD Samba4 Centos 7</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=AD_Samba4_Centos_7&amp;diff=2868"/>
		<updated>2016-02-04T23:01:35Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Installing Samba */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this wiki page is to document the steps needed to set up or recreate an Active Directory(AD) Environment using Samba 4. Not all features of a Windows Server AD are incorporated into Samba 4. At the time of writing/editing the current version of Samba 4 being used is: 4.1.16&lt;br /&gt;
&lt;br /&gt;
This page serves to show how to Setup Samba 4 on a Centos 7 machine and migrate over from Centos 6.&lt;br /&gt;
&lt;br /&gt;
Current operating system Samba 4 is run on: Centos 7&lt;br /&gt;
*'''Note''': Until this message removed consider the following a work in progress&lt;br /&gt;
=Samba 4 Active Directory Domain Controller=&lt;br /&gt;
==Install CentOS==&lt;br /&gt;
*Install a minimal version of Centos 7 on a VM or dev box&lt;br /&gt;
==Samba 4 Requirements==&lt;br /&gt;
*Here is a minimal list of packages needed to compile Samba 4 with AD support&lt;br /&gt;
 yum install perl gcc libacl-devel libblkid-devel gnutls-devel \&lt;br /&gt;
 readline-devel python-devel gdb pkgconfig krb5-workstation \&lt;br /&gt;
 zlib-devel setroubleshoot-server libaio-devel \&lt;br /&gt;
 setroubleshoot-plugins policycoreutils-python \&lt;br /&gt;
 libsemanage-python setools-libs-python setools-libs \&lt;br /&gt;
 popt-devel libpcap-devel sqlite-devel libidn-devel \&lt;br /&gt;
 libxml2-devel libacl-devel libsepol-devel libattr-devel \&lt;br /&gt;
 keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils \&lt;br /&gt;
 libxslt docbook-style-xsl openldap-devel pam-devel bzip2&lt;br /&gt;
&lt;br /&gt;
*Here are optional packages that are used in this guide&lt;br /&gt;
 yum install vim wget&lt;br /&gt;
&lt;br /&gt;
==Restoring==&lt;br /&gt;
*we are coming from a working environment running on centos 6, we are going to restore our databases to /usr/local/samba and then compile and install Samba 4 over them&lt;br /&gt;
*I have tried installing samba first and then restoring form backup however samba was having issues with wind the Winbind.so binary, a recompile and install fixed that issue, however by restoring first we avoid having to reinstall samba after restore&lt;br /&gt;
*These folders probably wont be there if you havent installed samba before, check to see before running command&lt;br /&gt;
 rm -rf /usr/local/samba/etc&lt;br /&gt;
 rm -rf /usr/local/samba/private&lt;br /&gt;
 rm -rf /usr/local/samba/var/locks/sysvol&lt;br /&gt;
*If /usr/local/samba does not exist(because samba has never been installed before) make the /usr/local/samba directory&lt;br /&gt;
 mkdir /usr/local/samba&lt;br /&gt;
*change directories to where you have your backups and do a restore&lt;br /&gt;
 cd /usr/local/backups&lt;br /&gt;
 tar -jxf etc.{Timestamp}.tar.bz2 -C /usr/local/samba/&lt;br /&gt;
 tar -jxf samba4_private.{Timestamp}.tar.bz2 -C /usr/local/samba/&lt;br /&gt;
 tar -jxf sysvol.{Timestamp}.tar.bz2 -C /usr/local/samba/&lt;br /&gt;
&lt;br /&gt;
 find /usr/local/samba/private/ -type f -name '*.ldb.bak' -print0 | while read -d $'\0' f ; do mv &amp;quot;$f&amp;quot; &amp;quot;${f%.bak}&amp;quot; ; done&lt;br /&gt;
*Our profiles are stored on an NFS server, copy over the auto.home file where our profiles are stored&lt;br /&gt;
 scp root@AD1.DOMAIN.EDU:/etc/auto.home /etc/&lt;br /&gt;
*restart autofs&lt;br /&gt;
 systemctl restart autofs&lt;br /&gt;
&lt;br /&gt;
==Installing Samba==&lt;br /&gt;
*For stable Samba version visit: http://www.samba.org/&lt;br /&gt;
*or(as of 02-18-15):&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.1.16.tar.gz&lt;br /&gt;
*Extract the archive if not done so already&lt;br /&gt;
 tar -zxvf samba-4.1.16.tar.gz&lt;br /&gt;
 cd ~/samba-4.1.16&lt;br /&gt;
 ./configure --enable-debug --enable-selftest --with-ads --with-systemd --with-winbind&lt;br /&gt;
*If it completes successfully, make sure it is Building with Active Directory support, if not you may have forgotten a few packages&lt;br /&gt;
*Finally compile and then install&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
*libgnutls needs to be linked like so(upgrade specific install):&lt;br /&gt;
 ln -s /usr/lib64/libgnutls.so.28 /usr/lib64/libgnutls.so.26&lt;br /&gt;
*The kerberos file needs to be configured properly&lt;br /&gt;
 vim /etc/krb5.conf&lt;br /&gt;
&lt;br /&gt;
 dns_lookup_realm = false&lt;br /&gt;
 dns_lookup_kdc = true&lt;br /&gt;
 default_realm = DOMAIN.EDU&lt;br /&gt;
*add samba directory to bashrc file&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/bin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 echo 'export PATH=$PATH:/usr/local/samba/sbin' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
*disable selinux for now&lt;br /&gt;
 vim /etc/sysconfig/selinux&lt;br /&gt;
*change enforcing=enabled to &lt;br /&gt;
 enforcing=disabled&lt;br /&gt;
*reboot the computer&lt;br /&gt;
 shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==Adding Samba to Systemd==&lt;br /&gt;
*create a samba.service file at /etc/systemd/system/samba.service&lt;br /&gt;
 vim /etc/systemd/system/samba.service&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description= Samba 4 Active Directory&lt;br /&gt;
 After=syslog.target&lt;br /&gt;
 After=network.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=forking&lt;br /&gt;
 PIDFile=/usr/local/samba/var/run/samba.pid&lt;br /&gt;
 ExecStart=/usr/local/samba/sbin/samba&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
==Adding winbind to nsswitch.conf==&lt;br /&gt;
*add winbind to /etc/nsswitch.conf&lt;br /&gt;
 vim /etc/nsswitch.conf&lt;br /&gt;
&lt;br /&gt;
 passwd:     files winbind sss&lt;br /&gt;
 shadow:     files sss&lt;br /&gt;
 group:      files winbind sss&lt;br /&gt;
*link winbind so that nssswitch can find and enumerate domain &lt;br /&gt;
 ln -s  /usr/local/samba/lib/libnss_winbind.so.2  /lib64/libnss_winbind.so&lt;br /&gt;
 ln  -s /lib64/libnss_winbind.so  /lib64/libnss_winbind.so.2&lt;br /&gt;
&lt;br /&gt;
==Adding Backup Script==&lt;br /&gt;
 cp ~/samba-4.1.16/source4/scripting/bin/samba_backup /usr/local/samba/sbin&lt;br /&gt;
 chown root:root /usr/local/samba/sbin/samba_backup&lt;br /&gt;
 chmod 750 /usr/local/samba/sbin/samba_backup&lt;br /&gt;
*make backup directory&lt;br /&gt;
 mkdir /usr/local/backups&lt;br /&gt;
*You can now run the samba backup script&lt;br /&gt;
 samba_backup&lt;br /&gt;
*or just add it to cron for weekly backups&lt;br /&gt;
 crontab -e&lt;br /&gt;
*insert the following&lt;br /&gt;
 #Run a weekly backup on Rumba for samba4 Active Directory&lt;br /&gt;
 0 3 * * 0 /usr/local/samba/bin/samba_backup &amp;gt;&amp;gt; /root/backup_logs/samba_bak.log 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
==Start/Stop Samba service==&lt;br /&gt;
*start the Samba service&lt;br /&gt;
 systemctl start samba&lt;br /&gt;
*enable the samba service on startup&lt;br /&gt;
 systemctl enable samba&lt;br /&gt;
*check the status of samba&lt;br /&gt;
 systemctl status samba&lt;br /&gt;
*If you need to stop the samba service use&lt;br /&gt;
 systemctl stop samba&lt;br /&gt;
&lt;br /&gt;
==Firewall==&lt;br /&gt;
*We prefer iptables so we are turning off firewalld and enabling iptables instead&lt;br /&gt;
 systemctl stop firewalld     # stop firewalld temporarily&lt;br /&gt;
 systemctl mask firewalld    # not sure what mask does, but I assume its similar to disable&lt;br /&gt;
 yum install iptables-services  # install iptables-services package&lt;br /&gt;
 systemctl enable iptables    # Enable the service at boot-time&lt;br /&gt;
*add in your rules into /ets/sysconfig/iptables (do this while iptables is off)&lt;br /&gt;
 systemctl start iptables     # start iptables&lt;br /&gt;
*the following will save the rules located at /etc/sysconfig/iptables&lt;br /&gt;
 service iptables save   # save iptables rules in /etc/sysconfig/iptables, overwriting current set&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2855</id>
		<title>Samba4 Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2855"/>
		<updated>2016-01-27T23:38:26Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Update Samba */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
&lt;br /&gt;
==Update Samba==&lt;br /&gt;
*When updating Samba you should only be doing a version change on one DC at a time. Then verify that the DC is working in the domain before upgrading other DCs, don't update more than one DC at a time, have proper backups!&lt;br /&gt;
*https://wiki.samba.org/index.php/Updating_Samba&lt;br /&gt;
*Stop service and make backup&lt;br /&gt;
 systemctl stop samba&lt;br /&gt;
 /usr/local/samba/bin/samba_backup&lt;br /&gt;
*Get samba, configure and install&lt;br /&gt;
 wget http://www.samba.org/samba/ftp/stable/samba-4.3.3.tar.gz&lt;br /&gt;
 tar -zxvf samba-4.3.3.tar.gz&lt;br /&gt;
 cd ~/samba-4.3.3&lt;br /&gt;
 ./configure --enable-debug --enable-selftest --with-ads --with-systemd --with-winbind&lt;br /&gt;
*Make sure configure completes successfully, be sure you have proper backups!!!&lt;br /&gt;
*Read the release notes to check compatibility. &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
*start the samba service&lt;br /&gt;
 systemctl start samba&lt;br /&gt;
*Go check the logs and verify the system came up correctly:&lt;br /&gt;
 tail /usr/local/samba/var/$LOGNAME.log&lt;br /&gt;
*Test around and see that replication is still in sync. Check that other DCs logs for errors about upgraded DC or replication.&lt;br /&gt;
&lt;br /&gt;
==Checking Replication==&lt;br /&gt;
*Check replication status &lt;br /&gt;
 samba-tool drs showrepl&lt;br /&gt;
*Force a repl:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba-tool_drs_replicate&lt;br /&gt;
&lt;br /&gt;
==Force Removal of DC==&lt;br /&gt;
*If a Samba4 DC goes offline and cannot be restored so that replication can resync with another DC it must be forcibly removed from the domain.&lt;br /&gt;
*If the failed DC owned any of the FSMO roles they must be seized by the current working DC. See link for howto:&lt;br /&gt;
*https://wiki.samba.org/index.php/Transfering_/_seizing_FSMO_roles&lt;br /&gt;
*Once all roles are on a working DC you may force remove the down DC from the domain. Use the following script:&lt;br /&gt;
*https://gallery.technet.microsoft.com/scriptcenter/d31f091f-2642-4ede-9f97-0e1cc4d577f3#content&lt;br /&gt;
*Check in ADUC under Domain Controllers(or appropriate OU) the DC was removed, if not delete the object.&lt;br /&gt;
*Open up the DNS Manager and remove all entries for the failed DC.&lt;br /&gt;
*Never restore/reintroduce the failed DC back into the domain, it will cause replication issues.&lt;br /&gt;
*To bring another DC up, setup samba as usual and join the domain as a DC using samba-tool:&lt;br /&gt;
*https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory&lt;br /&gt;
&lt;br /&gt;
==Demote a DC==&lt;br /&gt;
*https://wiki.samba.org/index.php/Demote_a_Samba_AD_DC&lt;br /&gt;
&lt;br /&gt;
==Join a DC==&lt;br /&gt;
*https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory&lt;br /&gt;
&lt;br /&gt;
==Backup and Restore==&lt;br /&gt;
*https://wiki.samba.org/index.php/Backup_and_restore_an_Samba_AD_DC&lt;br /&gt;
&lt;br /&gt;
==LDB Search/Edit==&lt;br /&gt;
*ldb search example:&lt;br /&gt;
 ldbsearch -H /usr/local/samba/private/sam.ldb.d/DC\=DOMAINDNSZONES\,DC\=***\,DC\=***\,DC\=***\,DC\=***.ldb&lt;br /&gt;
&lt;br /&gt;
*weird error with tombstone lifetime&lt;br /&gt;
 [2015/05/20 14:27:27.377734,  0] ../source4/dsdb/repl/replicated_objects.c:783(dsdb_replicated_objects_commit)&lt;br /&gt;
  Failed to apply records: replmd_replicated_apply_add: error during DRS repl ADD: No objectClass found in replPropertyMetaData for DC=lluvia\0ACNF:fe4415b8-8a9d-417d-abb3-77771ec99f88\0ADEL:fe4415b8-8a9d-417d-abb3-77771ec99f88,CN=Deleted Objects,DC=DomainDnsZones,DC=***,DC=***,DC=***,DC=edu!&lt;br /&gt;
  : Object class violation&lt;br /&gt;
*use ldbedit to change the tombstone lifetime from 6 months to 10 days to get rid of all extra &amp;quot;Deleted Objects&amp;quot; that wont replicate&lt;br /&gt;
 ldbedit -H ldap://localhost -Uadministrator -s base -b &amp;quot;CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=***,DC=***,DC=***,DC=***&amp;quot;&lt;br /&gt;
*https://wiki.samba.org/index.php/Restoring_deleted_AD_objects#Changing_the_defaults_for_msDS-deletedObjectLifetime_and_tombstoneLifetime&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2854</id>
		<title>Samba4 Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2854"/>
		<updated>2016-01-27T23:02:14Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Checking Replication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
&lt;br /&gt;
==Update Samba==&lt;br /&gt;
*https://wiki.samba.org/index.php/Updating_Samba&lt;br /&gt;
 systemctl stop samba&lt;br /&gt;
&lt;br /&gt;
==Checking Replication==&lt;br /&gt;
*Check replication status &lt;br /&gt;
 samba-tool drs showrepl&lt;br /&gt;
*Force a repl:&lt;br /&gt;
*https://wiki.samba.org/index.php/Samba-tool_drs_replicate&lt;br /&gt;
&lt;br /&gt;
==Force Removal of DC==&lt;br /&gt;
*If a Samba4 DC goes offline and cannot be restored so that replication can resync with another DC it must be forcibly removed from the domain.&lt;br /&gt;
*If the failed DC owned any of the FSMO roles they must be seized by the current working DC. See link for howto:&lt;br /&gt;
*https://wiki.samba.org/index.php/Transfering_/_seizing_FSMO_roles&lt;br /&gt;
*Once all roles are on a working DC you may force remove the down DC from the domain. Use the following script:&lt;br /&gt;
*https://gallery.technet.microsoft.com/scriptcenter/d31f091f-2642-4ede-9f97-0e1cc4d577f3#content&lt;br /&gt;
*Check in ADUC under Domain Controllers(or appropriate OU) the DC was removed, if not delete the object.&lt;br /&gt;
*Open up the DNS Manager and remove all entries for the failed DC.&lt;br /&gt;
*Never restore/reintroduce the failed DC back into the domain, it will cause replication issues.&lt;br /&gt;
*To bring another DC up, setup samba as usual and join the domain as a DC using samba-tool:&lt;br /&gt;
*https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory&lt;br /&gt;
&lt;br /&gt;
==Demote a DC==&lt;br /&gt;
*https://wiki.samba.org/index.php/Demote_a_Samba_AD_DC&lt;br /&gt;
&lt;br /&gt;
==Join a DC==&lt;br /&gt;
*https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory&lt;br /&gt;
&lt;br /&gt;
==Backup and Restore==&lt;br /&gt;
*https://wiki.samba.org/index.php/Backup_and_restore_an_Samba_AD_DC&lt;br /&gt;
&lt;br /&gt;
==LDB Search/Edit==&lt;br /&gt;
*ldb search example:&lt;br /&gt;
 ldbsearch -H /usr/local/samba/private/sam.ldb.d/DC\=DOMAINDNSZONES\,DC\=***\,DC\=***\,DC\=***\,DC\=***.ldb&lt;br /&gt;
&lt;br /&gt;
*weird error with tombstone lifetime&lt;br /&gt;
 [2015/05/20 14:27:27.377734,  0] ../source4/dsdb/repl/replicated_objects.c:783(dsdb_replicated_objects_commit)&lt;br /&gt;
  Failed to apply records: replmd_replicated_apply_add: error during DRS repl ADD: No objectClass found in replPropertyMetaData for DC=lluvia\0ACNF:fe4415b8-8a9d-417d-abb3-77771ec99f88\0ADEL:fe4415b8-8a9d-417d-abb3-77771ec99f88,CN=Deleted Objects,DC=DomainDnsZones,DC=***,DC=***,DC=***,DC=edu!&lt;br /&gt;
  : Object class violation&lt;br /&gt;
*use ldbedit to change the tombstone lifetime from 6 months to 10 days to get rid of all extra &amp;quot;Deleted Objects&amp;quot; that wont replicate&lt;br /&gt;
 ldbedit -H ldap://localhost -Uadministrator -s base -b &amp;quot;CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=***,DC=***,DC=***,DC=***&amp;quot;&lt;br /&gt;
*https://wiki.samba.org/index.php/Restoring_deleted_AD_objects#Changing_the_defaults_for_msDS-deletedObjectLifetime_and_tombstoneLifetime&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2853</id>
		<title>Samba4 Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2853"/>
		<updated>2016-01-27T23:00:05Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Update Samba */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
&lt;br /&gt;
==Update Samba==&lt;br /&gt;
*https://wiki.samba.org/index.php/Updating_Samba&lt;br /&gt;
 systemctl stop samba&lt;br /&gt;
&lt;br /&gt;
==Checking Replication==&lt;br /&gt;
*Check replication status &lt;br /&gt;
 samba-tool drs showrepl&lt;br /&gt;
&lt;br /&gt;
==Force Removal of DC==&lt;br /&gt;
*If a Samba4 DC goes offline and cannot be restored so that replication can resync with another DC it must be forcibly removed from the domain.&lt;br /&gt;
*If the failed DC owned any of the FSMO roles they must be seized by the current working DC. See link for howto:&lt;br /&gt;
*https://wiki.samba.org/index.php/Transfering_/_seizing_FSMO_roles&lt;br /&gt;
*Once all roles are on a working DC you may force remove the down DC from the domain. Use the following script:&lt;br /&gt;
*https://gallery.technet.microsoft.com/scriptcenter/d31f091f-2642-4ede-9f97-0e1cc4d577f3#content&lt;br /&gt;
*Check in ADUC under Domain Controllers(or appropriate OU) the DC was removed, if not delete the object.&lt;br /&gt;
*Open up the DNS Manager and remove all entries for the failed DC.&lt;br /&gt;
*Never restore/reintroduce the failed DC back into the domain, it will cause replication issues.&lt;br /&gt;
*To bring another DC up, setup samba as usual and join the domain as a DC using samba-tool:&lt;br /&gt;
*https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory&lt;br /&gt;
&lt;br /&gt;
==Demote a DC==&lt;br /&gt;
*https://wiki.samba.org/index.php/Demote_a_Samba_AD_DC&lt;br /&gt;
&lt;br /&gt;
==Join a DC==&lt;br /&gt;
*https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory&lt;br /&gt;
&lt;br /&gt;
==Backup and Restore==&lt;br /&gt;
*https://wiki.samba.org/index.php/Backup_and_restore_an_Samba_AD_DC&lt;br /&gt;
&lt;br /&gt;
==LDB Search/Edit==&lt;br /&gt;
*ldb search example:&lt;br /&gt;
 ldbsearch -H /usr/local/samba/private/sam.ldb.d/DC\=DOMAINDNSZONES\,DC\=***\,DC\=***\,DC\=***\,DC\=***.ldb&lt;br /&gt;
&lt;br /&gt;
*weird error with tombstone lifetime&lt;br /&gt;
 [2015/05/20 14:27:27.377734,  0] ../source4/dsdb/repl/replicated_objects.c:783(dsdb_replicated_objects_commit)&lt;br /&gt;
  Failed to apply records: replmd_replicated_apply_add: error during DRS repl ADD: No objectClass found in replPropertyMetaData for DC=lluvia\0ACNF:fe4415b8-8a9d-417d-abb3-77771ec99f88\0ADEL:fe4415b8-8a9d-417d-abb3-77771ec99f88,CN=Deleted Objects,DC=DomainDnsZones,DC=***,DC=***,DC=***,DC=edu!&lt;br /&gt;
  : Object class violation&lt;br /&gt;
*use ldbedit to change the tombstone lifetime from 6 months to 10 days to get rid of all extra &amp;quot;Deleted Objects&amp;quot; that wont replicate&lt;br /&gt;
 ldbedit -H ldap://localhost -Uadministrator -s base -b &amp;quot;CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=***,DC=***,DC=***,DC=***&amp;quot;&lt;br /&gt;
*https://wiki.samba.org/index.php/Restoring_deleted_AD_objects#Changing_the_defaults_for_msDS-deletedObjectLifetime_and_tombstoneLifetime&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2852</id>
		<title>Samba4 Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2852"/>
		<updated>2016-01-27T22:26:51Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Troubleshooting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
&lt;br /&gt;
==Update Samba==&lt;br /&gt;
*https://wiki.samba.org/index.php/Updating_Samba&lt;br /&gt;
&lt;br /&gt;
==Checking Replication==&lt;br /&gt;
*Check replication status &lt;br /&gt;
 samba-tool drs showrepl&lt;br /&gt;
&lt;br /&gt;
==Force Removal of DC==&lt;br /&gt;
*If a Samba4 DC goes offline and cannot be restored so that replication can resync with another DC it must be forcibly removed from the domain.&lt;br /&gt;
*If the failed DC owned any of the FSMO roles they must be seized by the current working DC. See link for howto:&lt;br /&gt;
*https://wiki.samba.org/index.php/Transfering_/_seizing_FSMO_roles&lt;br /&gt;
*Once all roles are on a working DC you may force remove the down DC from the domain. Use the following script:&lt;br /&gt;
*https://gallery.technet.microsoft.com/scriptcenter/d31f091f-2642-4ede-9f97-0e1cc4d577f3#content&lt;br /&gt;
*Check in ADUC under Domain Controllers(or appropriate OU) the DC was removed, if not delete the object.&lt;br /&gt;
*Open up the DNS Manager and remove all entries for the failed DC.&lt;br /&gt;
*Never restore/reintroduce the failed DC back into the domain, it will cause replication issues.&lt;br /&gt;
*To bring another DC up, setup samba as usual and join the domain as a DC using samba-tool:&lt;br /&gt;
*https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory&lt;br /&gt;
&lt;br /&gt;
==Demote a DC==&lt;br /&gt;
*https://wiki.samba.org/index.php/Demote_a_Samba_AD_DC&lt;br /&gt;
&lt;br /&gt;
==Join a DC==&lt;br /&gt;
*https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory&lt;br /&gt;
&lt;br /&gt;
==Backup and Restore==&lt;br /&gt;
*https://wiki.samba.org/index.php/Backup_and_restore_an_Samba_AD_DC&lt;br /&gt;
&lt;br /&gt;
==LDB Search/Edit==&lt;br /&gt;
*ldb search example:&lt;br /&gt;
 ldbsearch -H /usr/local/samba/private/sam.ldb.d/DC\=DOMAINDNSZONES\,DC\=***\,DC\=***\,DC\=***\,DC\=***.ldb&lt;br /&gt;
&lt;br /&gt;
*weird error with tombstone lifetime&lt;br /&gt;
 [2015/05/20 14:27:27.377734,  0] ../source4/dsdb/repl/replicated_objects.c:783(dsdb_replicated_objects_commit)&lt;br /&gt;
  Failed to apply records: replmd_replicated_apply_add: error during DRS repl ADD: No objectClass found in replPropertyMetaData for DC=lluvia\0ACNF:fe4415b8-8a9d-417d-abb3-77771ec99f88\0ADEL:fe4415b8-8a9d-417d-abb3-77771ec99f88,CN=Deleted Objects,DC=DomainDnsZones,DC=***,DC=***,DC=***,DC=edu!&lt;br /&gt;
  : Object class violation&lt;br /&gt;
*use ldbedit to change the tombstone lifetime from 6 months to 10 days to get rid of all extra &amp;quot;Deleted Objects&amp;quot; that wont replicate&lt;br /&gt;
 ldbedit -H ldap://localhost -Uadministrator -s base -b &amp;quot;CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=***,DC=***,DC=***,DC=***&amp;quot;&lt;br /&gt;
*https://wiki.samba.org/index.php/Restoring_deleted_AD_objects#Changing_the_defaults_for_msDS-deletedObjectLifetime_and_tombstoneLifetime&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2851</id>
		<title>Samba4 Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2851"/>
		<updated>2016-01-27T22:25:54Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Troubleshooting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
==Checking Replication==&lt;br /&gt;
*Check replication status &lt;br /&gt;
 samba-tool drs showrepl&lt;br /&gt;
&lt;br /&gt;
==Force Removal of DC==&lt;br /&gt;
*If a Samba4 DC goes offline and cannot be restored so that replication can resync with another DC it must be forcibly removed from the domain.&lt;br /&gt;
*If the failed DC owned any of the FSMO roles they must be seized by the current working DC. See link for howto:&lt;br /&gt;
*https://wiki.samba.org/index.php/Transfering_/_seizing_FSMO_roles&lt;br /&gt;
*Once all roles are on a working DC you may force remove the down DC from the domain. Use the following script:&lt;br /&gt;
*https://gallery.technet.microsoft.com/scriptcenter/d31f091f-2642-4ede-9f97-0e1cc4d577f3#content&lt;br /&gt;
*Check in ADUC under Domain Controllers(or appropriate OU) the DC was removed, if not delete the object.&lt;br /&gt;
*Open up the DNS Manager and remove all entries for the failed DC.&lt;br /&gt;
*Never restore/reintroduce the failed DC back into the domain, it will cause replication issues.&lt;br /&gt;
*To bring another DC up, setup samba as usual and join the domain as a DC using samba-tool:&lt;br /&gt;
*https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory&lt;br /&gt;
&lt;br /&gt;
==Demote a DC==&lt;br /&gt;
*https://wiki.samba.org/index.php/Demote_a_Samba_AD_DC&lt;br /&gt;
&lt;br /&gt;
==Join a DC==&lt;br /&gt;
*https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory&lt;br /&gt;
&lt;br /&gt;
==Backup and Restore==&lt;br /&gt;
*https://wiki.samba.org/index.php/Backup_and_restore_an_Samba_AD_DC&lt;br /&gt;
&lt;br /&gt;
==LDB Search/Edit==&lt;br /&gt;
*ldb search example:&lt;br /&gt;
 ldbsearch -H /usr/local/samba/private/sam.ldb.d/DC\=DOMAINDNSZONES\,DC\=***\,DC\=***\,DC\=***\,DC\=***.ldb&lt;br /&gt;
&lt;br /&gt;
*weird error with tombstone lifetime&lt;br /&gt;
 [2015/05/20 14:27:27.377734,  0] ../source4/dsdb/repl/replicated_objects.c:783(dsdb_replicated_objects_commit)&lt;br /&gt;
  Failed to apply records: replmd_replicated_apply_add: error during DRS repl ADD: No objectClass found in replPropertyMetaData for DC=lluvia\0ACNF:fe4415b8-8a9d-417d-abb3-77771ec99f88\0ADEL:fe4415b8-8a9d-417d-abb3-77771ec99f88,CN=Deleted Objects,DC=DomainDnsZones,DC=***,DC=***,DC=***,DC=edu!&lt;br /&gt;
  : Object class violation&lt;br /&gt;
*use ldbedit to change the tombstone lifetime from 6 months to 10 days to get rid of all extra &amp;quot;Deleted Objects&amp;quot; that wont replicate&lt;br /&gt;
 ldbedit -H ldap://localhost -Uadministrator -s base -b &amp;quot;CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=***,DC=***,DC=***,DC=***&amp;quot;&lt;br /&gt;
*https://wiki.samba.org/index.php/Restoring_deleted_AD_objects#Changing_the_defaults_for_msDS-deletedObjectLifetime_and_tombstoneLifetime&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2850</id>
		<title>Samba4 Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2850"/>
		<updated>2016-01-27T22:24:42Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Troubleshooting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
==Checking Replication==&lt;br /&gt;
*Check replication status &lt;br /&gt;
 samba-tool drs showrepl&lt;br /&gt;
&lt;br /&gt;
==Force Removal of DC==&lt;br /&gt;
*If a Samba4 DC goes offline and cannot be restored so that replication can resync with another DC it must be forcibly removed from the domain.&lt;br /&gt;
*If the failed DC owned any of the FSMO roles they must be seized by the current working DC. See link for howto:&lt;br /&gt;
*https://wiki.samba.org/index.php/Transfering_/_seizing_FSMO_roles&lt;br /&gt;
*Once all roles are on a working DC you may force remove the down DC from the domain. Use the following script:&lt;br /&gt;
*https://gallery.technet.microsoft.com/scriptcenter/d31f091f-2642-4ede-9f97-0e1cc4d577f3#content&lt;br /&gt;
*Check in ADUC under Domain Controllers(or appropriate OU) the DC was removed, if not delete the object.&lt;br /&gt;
*Open up the DNS Manager and remove all entries for the failed DC.&lt;br /&gt;
*Never restore/reintroduce the failed DC back into the domain, it will cause replication issues.&lt;br /&gt;
*To bring another DC up, setup samba as usual and join the domain as a DC using samba-tool:&lt;br /&gt;
*https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory&lt;br /&gt;
&lt;br /&gt;
==Demote a DC==&lt;br /&gt;
*https://wiki.samba.org/index.php/Demote_a_Samba_AD_DC&lt;br /&gt;
&lt;br /&gt;
==LDB Search/Edit==&lt;br /&gt;
*ldb search example:&lt;br /&gt;
 ldbsearch -H /usr/local/samba/private/sam.ldb.d/DC\=DOMAINDNSZONES\,DC\=***\,DC\=***\,DC\=***\,DC\=***.ldb&lt;br /&gt;
&lt;br /&gt;
*weird error with tombstone lifetime&lt;br /&gt;
 [2015/05/20 14:27:27.377734,  0] ../source4/dsdb/repl/replicated_objects.c:783(dsdb_replicated_objects_commit)&lt;br /&gt;
  Failed to apply records: replmd_replicated_apply_add: error during DRS repl ADD: No objectClass found in replPropertyMetaData for DC=lluvia\0ACNF:fe4415b8-8a9d-417d-abb3-77771ec99f88\0ADEL:fe4415b8-8a9d-417d-abb3-77771ec99f88,CN=Deleted Objects,DC=DomainDnsZones,DC=***,DC=***,DC=***,DC=edu!&lt;br /&gt;
  : Object class violation&lt;br /&gt;
*use ldbedit to change the tombstone lifetime from 6 months to 10 days to get rid of all extra &amp;quot;Deleted Objects&amp;quot; that wont replicate&lt;br /&gt;
 ldbedit -H ldap://localhost -Uadministrator -s base -b &amp;quot;CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=***,DC=***,DC=***,DC=***&amp;quot;&lt;br /&gt;
*https://wiki.samba.org/index.php/Restoring_deleted_AD_objects#Changing_the_defaults_for_msDS-deletedObjectLifetime_and_tombstoneLifetime&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2849</id>
		<title>Samba4 Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2849"/>
		<updated>2016-01-27T22:24:00Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Force Removal of DC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
==Checking Replication==&lt;br /&gt;
*Check replication status &lt;br /&gt;
 samba-tool drs showrepl&lt;br /&gt;
&lt;br /&gt;
==Force Removal of DC==&lt;br /&gt;
*If a Samba4 DC goes offline and cannot be restored so that replication can resync with another DC it must be forcibly removed from the domain.&lt;br /&gt;
*If the failed DC owned any of the FSMO roles they must be seized by the current working DC. See link for howto:&lt;br /&gt;
*https://wiki.samba.org/index.php/Transfering_/_seizing_FSMO_roles&lt;br /&gt;
*Once all roles are on a working DC you may force remove the down DC from the domain. Use the following script:&lt;br /&gt;
*https://gallery.technet.microsoft.com/scriptcenter/d31f091f-2642-4ede-9f97-0e1cc4d577f3#content&lt;br /&gt;
*Check in ADUC under Domain Controllers(or appropriate OU) the DC was removed, if not delete the object.&lt;br /&gt;
*Open up the DNS Manager and remove all entries for the failed DC.&lt;br /&gt;
*Never restore/reintroduce the failed DC back into the domain, it will cause replication issues.&lt;br /&gt;
*To bring another DC up, setup samba as usual and join the domain as a DC using samba-tool:&lt;br /&gt;
*https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory&lt;br /&gt;
&lt;br /&gt;
==LDB Search/Edit==&lt;br /&gt;
*ldb search example:&lt;br /&gt;
 ldbsearch -H /usr/local/samba/private/sam.ldb.d/DC\=DOMAINDNSZONES\,DC\=***\,DC\=***\,DC\=***\,DC\=***.ldb&lt;br /&gt;
&lt;br /&gt;
*weird error with tombstone lifetime&lt;br /&gt;
 [2015/05/20 14:27:27.377734,  0] ../source4/dsdb/repl/replicated_objects.c:783(dsdb_replicated_objects_commit)&lt;br /&gt;
  Failed to apply records: replmd_replicated_apply_add: error during DRS repl ADD: No objectClass found in replPropertyMetaData for DC=lluvia\0ACNF:fe4415b8-8a9d-417d-abb3-77771ec99f88\0ADEL:fe4415b8-8a9d-417d-abb3-77771ec99f88,CN=Deleted Objects,DC=DomainDnsZones,DC=***,DC=***,DC=***,DC=edu!&lt;br /&gt;
  : Object class violation&lt;br /&gt;
*use ldbedit to change the tombstone lifetime from 6 months to 10 days to get rid of all extra &amp;quot;Deleted Objects&amp;quot; that wont replicate&lt;br /&gt;
 ldbedit -H ldap://localhost -Uadministrator -s base -b &amp;quot;CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=***,DC=***,DC=***,DC=***&amp;quot;&lt;br /&gt;
*https://wiki.samba.org/index.php/Restoring_deleted_AD_objects#Changing_the_defaults_for_msDS-deletedObjectLifetime_and_tombstoneLifetime&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2848</id>
		<title>Samba4 Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2848"/>
		<updated>2016-01-27T22:14:15Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
==Checking Replication==&lt;br /&gt;
*Check replication status &lt;br /&gt;
 samba-tool drs showrepl&lt;br /&gt;
&lt;br /&gt;
==Force Removal of DC==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==LDB Search/Edit==&lt;br /&gt;
*ldb search example:&lt;br /&gt;
 ldbsearch -H /usr/local/samba/private/sam.ldb.d/DC\=DOMAINDNSZONES\,DC\=***\,DC\=***\,DC\=***\,DC\=***.ldb&lt;br /&gt;
&lt;br /&gt;
*weird error with tombstone lifetime&lt;br /&gt;
 [2015/05/20 14:27:27.377734,  0] ../source4/dsdb/repl/replicated_objects.c:783(dsdb_replicated_objects_commit)&lt;br /&gt;
  Failed to apply records: replmd_replicated_apply_add: error during DRS repl ADD: No objectClass found in replPropertyMetaData for DC=lluvia\0ACNF:fe4415b8-8a9d-417d-abb3-77771ec99f88\0ADEL:fe4415b8-8a9d-417d-abb3-77771ec99f88,CN=Deleted Objects,DC=DomainDnsZones,DC=***,DC=***,DC=***,DC=edu!&lt;br /&gt;
  : Object class violation&lt;br /&gt;
*use ldbedit to change the tombstone lifetime from 6 months to 10 days to get rid of all extra &amp;quot;Deleted Objects&amp;quot; that wont replicate&lt;br /&gt;
 ldbedit -H ldap://localhost -Uadministrator -s base -b &amp;quot;CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=***,DC=***,DC=***,DC=***&amp;quot;&lt;br /&gt;
*https://wiki.samba.org/index.php/Restoring_deleted_AD_objects#Changing_the_defaults_for_msDS-deletedObjectLifetime_and_tombstoneLifetime&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2847</id>
		<title>Samba4 Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=Samba4_Troubleshooting&amp;diff=2847"/>
		<updated>2016-01-27T22:13:49Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Active Projects]]&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
[[Category:Samba]]&lt;br /&gt;
[[Category:Samba4AD]]&lt;br /&gt;
&lt;br /&gt;
==Checking Replication==&lt;br /&gt;
*Check replication status &lt;br /&gt;
 samba-tool drs showrepl&lt;br /&gt;
&lt;br /&gt;
==Force Removal of DC==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==LDB Search/Edit==&lt;br /&gt;
*ldb search example:&lt;br /&gt;
 ldbsearch -H /usr/local/samba/private/sam.ldb.d/DC\=DOMAINDNSZONES\,DC\=***\,DC\=***\,DC\=***\,DC\=***.ldb&lt;br /&gt;
&lt;br /&gt;
*weird error with tombstone lifetime&lt;br /&gt;
 [2015/05/20 14:27:27.377734,  0] ../source4/dsdb/repl/replicated_objects.c:783(dsdb_replicated_objects_commit)&lt;br /&gt;
  Failed to apply records: replmd_replicated_apply_add: error during DRS repl ADD: No objectClass found in replPropertyMetaData for DC=lluvia\0ACNF:fe4415b8-8a9d-417d-abb3-77771ec99f88\0ADEL:fe4415b8-8a9d-417d-abb3-77771ec99f88,CN=Deleted Objects,DC=DomainDnsZones,DC=***,DC=***,DC=***,DC=edu!&lt;br /&gt;
  : Object class violation&lt;br /&gt;
*use ldbedit to change the tombstone lifetime from 6 months to 10 days to get rid of all extra &amp;quot;Deleted Objects&amp;quot; that wont replicate&lt;br /&gt;
 ldbedit -H ldap://localhost -Uadministrator -s base -b &amp;quot;CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=***,DC=***,DC=***,DC=***&amp;quot;&lt;br /&gt;
*https://wiki.samba.org/index.php/Restoring_deleted_AD_objects#Changing_the_defaults_for_msDS-deletedObjectLifetime_and_tombstoneLifetime&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2846</id>
		<title>CISN Display CentOS</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2846"/>
		<updated>2015-12-16T23:24:49Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Additional Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:CISN]]&lt;br /&gt;
==Introduction==&lt;br /&gt;
This page will attempt to document the creation of a kiosk type display of the CISN Display.  &lt;br /&gt;
The CISN Display software displays near real-time earthquake location information available via the network.&lt;br /&gt;
A complementary component would be a waveform viewer showing seismograms (in real time) from various locations around&lt;br /&gt;
California (or beyond), but we have not had time to mount a concerted effort along those lines yet.&lt;br /&gt;
==Historical Notes==&lt;br /&gt;
*http://wiki.eri.ucsb.edu/stadm/CISN_Display&lt;br /&gt;
=Installation Guide=&lt;br /&gt;
==Setup==&lt;br /&gt;
*Install centos 6 on a compatible system, we will use a script that runs off this machine&lt;br /&gt;
**note:have not tested on centos minimal, install centos with a gui, script can be run remotely&lt;br /&gt;
*once installed run the following script to get the CISN Display installed as a kiosk&lt;br /&gt;
*Download [[Media: make_cisn.sh]]&lt;br /&gt;
==Additional Steps==&lt;br /&gt;
*after restart you have to type in credentials for cisn_display&lt;br /&gt;
*set a password for the kiosk user&lt;br /&gt;
*add a sleep and reboot to the crontab&lt;br /&gt;
 #Sleep at 8pm everyday for 11 hours, reboot at 7:30 am&lt;br /&gt;
 0 20 * * * /usr/sbin/rtcwake -m mem -s 39600&lt;br /&gt;
 30 7 * * * /sbin/shutdown -r now&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Adapted from: http://www.marcinwilk.eu/lang/en-us/2014/05/scientific-linux-6-centos-6-kiosk/&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=File:Make_cisn.sh&amp;diff=2845</id>
		<title>File:Make cisn.sh</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=File:Make_cisn.sh&amp;diff=2845"/>
		<updated>2015-12-16T19:44:12Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: Makes a kiosk for CISN Display on CentOS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Makes a kiosk for CISN Display on CentOS&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2844</id>
		<title>CISN Display CentOS</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2844"/>
		<updated>2015-12-16T19:39:02Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Additional Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:CISN]]&lt;br /&gt;
==Introduction==&lt;br /&gt;
This page will attempt to document the creation of a kiosk type display of the CISN Display.  &lt;br /&gt;
The CISN Display software displays near real-time earthquake location information available via the network.&lt;br /&gt;
A complementary component would be a waveform viewer showing seismograms (in real time) from various locations around&lt;br /&gt;
California (or beyond), but we have not had time to mount a concerted effort along those lines yet.&lt;br /&gt;
==Historical Notes==&lt;br /&gt;
*http://wiki.eri.ucsb.edu/stadm/CISN_Display&lt;br /&gt;
=Installation Guide=&lt;br /&gt;
==Setup==&lt;br /&gt;
*Install centos 6 on a compatible system, we will use a script that runs off this machine&lt;br /&gt;
**note:have not tested on centos minimal, install centos with a gui, script can be run remotely&lt;br /&gt;
*once installed run the following script to get the CISN Display installed as a kiosk&lt;br /&gt;
*Download [[Media: make_cisn.sh]]&lt;br /&gt;
==Additional Steps==&lt;br /&gt;
*after restart you have to type in credentials for cisn_display&lt;br /&gt;
*set a password for the kiosk user&lt;br /&gt;
==References==&lt;br /&gt;
*Adapted from: http://www.marcinwilk.eu/lang/en-us/2014/05/scientific-linux-6-centos-6-kiosk/&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2843</id>
		<title>CISN Display CentOS</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2843"/>
		<updated>2015-12-16T19:37:28Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Additional Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:CISN]]&lt;br /&gt;
==Introduction==&lt;br /&gt;
This page will attempt to document the creation of a kiosk type display of the CISN Display.  &lt;br /&gt;
The CISN Display software displays near real-time earthquake location information available via the network.&lt;br /&gt;
A complementary component would be a waveform viewer showing seismograms (in real time) from various locations around&lt;br /&gt;
California (or beyond), but we have not had time to mount a concerted effort along those lines yet.&lt;br /&gt;
==Historical Notes==&lt;br /&gt;
*http://wiki.eri.ucsb.edu/stadm/CISN_Display&lt;br /&gt;
=Installation Guide=&lt;br /&gt;
==Setup==&lt;br /&gt;
*Install centos 6 on a compatible system, we will use a script that runs off this machine&lt;br /&gt;
**note:have not tested on centos minimal, install centos with a gui, script can be run remotely&lt;br /&gt;
*once installed run the following script to get the CISN Display installed as a kiosk&lt;br /&gt;
*Download [[Media: make_cisn.sh]]&lt;br /&gt;
==Additional Steps==&lt;br /&gt;
*after restart you have to type in credentials for cisn_display&lt;br /&gt;
*set a password for the kiosk user&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2842</id>
		<title>CISN Display CentOS</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2842"/>
		<updated>2015-12-16T19:32:44Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Installation Guide */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:CISN]]&lt;br /&gt;
==Introduction==&lt;br /&gt;
This page will attempt to document the creation of a kiosk type display of the CISN Display.  &lt;br /&gt;
The CISN Display software displays near real-time earthquake location information available via the network.&lt;br /&gt;
A complementary component would be a waveform viewer showing seismograms (in real time) from various locations around&lt;br /&gt;
California (or beyond), but we have not had time to mount a concerted effort along those lines yet.&lt;br /&gt;
==Historical Notes==&lt;br /&gt;
*http://wiki.eri.ucsb.edu/stadm/CISN_Display&lt;br /&gt;
=Installation Guide=&lt;br /&gt;
==Setup==&lt;br /&gt;
*Install centos 6 on a compatible system, we will use a script that runs off this machine&lt;br /&gt;
**note:have not tested on centos minimal, install centos with a gui, script can be run remotely&lt;br /&gt;
*once installed run the following script to get the CISN Display installed as a kiosk&lt;br /&gt;
*Download [[Media: make_cisn.sh]]&lt;br /&gt;
==Additional Steps==&lt;br /&gt;
*after restart you have to type in credentials for cisn_display&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2841</id>
		<title>CISN Display CentOS</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2841"/>
		<updated>2015-12-16T19:31:54Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:CISN]]&lt;br /&gt;
==Introduction==&lt;br /&gt;
This page will attempt to document the creation of a kiosk type display of the CISN Display.  &lt;br /&gt;
The CISN Display software displays near real-time earthquake location information available via the network.&lt;br /&gt;
A complementary component would be a waveform viewer showing seismograms (in real time) from various locations around&lt;br /&gt;
California (or beyond), but we have not had time to mount a concerted effort along those lines yet.&lt;br /&gt;
==Historical Notes==&lt;br /&gt;
*http://wiki.eri.ucsb.edu/stadm/CISN_Display&lt;br /&gt;
=Installation Guide=&lt;br /&gt;
==Setup==&lt;br /&gt;
*Install centos 6 on a compatible system, we will use a script that runs off this machine&lt;br /&gt;
**note:have not tested on centos minimal, install centos with a gui, script can be run remotely&lt;br /&gt;
*once installed run the following script to get the CISN Display installed as a kiosk&lt;br /&gt;
&lt;br /&gt;
==Additional Steps==&lt;br /&gt;
*after restart you have to type in credentials for cisn_display&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2840</id>
		<title>CISN Display CentOS</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2840"/>
		<updated>2015-12-16T19:30:39Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: /* Additional Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:CISN]]&lt;br /&gt;
==Introduction==&lt;br /&gt;
This page will attempt to document the creation of a kiosk type display of the CISN Display.  &lt;br /&gt;
The CISN Display software displays near real-time earthquake location information available via the network.&lt;br /&gt;
A complementary component would be a waveform viewer showing seismograms (in real time) from various locations around&lt;br /&gt;
California (or beyond), but we have not had time to mount a concerted effort along those lines yet.&lt;br /&gt;
==Historical Notes==&lt;br /&gt;
*http://wiki.eri.ucsb.edu/stadm/CISN_Display&lt;br /&gt;
=Installation Guide=&lt;br /&gt;
==Setup==&lt;br /&gt;
*Install centos 6 on a compatible system, we will use a script that runs off this machine&lt;br /&gt;
*once installed run the following script to get the CISN Display installed as a kiosk&lt;br /&gt;
==Additional Steps==&lt;br /&gt;
*after restart you have to type in credentials for cisn_display&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2839</id>
		<title>CISN Display CentOS</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2839"/>
		<updated>2015-12-14T22:51:15Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:CISN]]&lt;br /&gt;
==Introduction==&lt;br /&gt;
This page will attempt to document the creation of a kiosk type display of the CISN Display.  &lt;br /&gt;
The CISN Display software displays near real-time earthquake location information available via the network.&lt;br /&gt;
A complementary component would be a waveform viewer showing seismograms (in real time) from various locations around&lt;br /&gt;
California (or beyond), but we have not had time to mount a concerted effort along those lines yet.&lt;br /&gt;
==Historical Notes==&lt;br /&gt;
*http://wiki.eri.ucsb.edu/stadm/CISN_Display&lt;br /&gt;
=Installation Guide=&lt;br /&gt;
==Setup==&lt;br /&gt;
*Install centos 6 on a compatible system, we will use a script that runs off this machine&lt;br /&gt;
*once installed run the following script to get the CISN Display installed as a kiosk&lt;br /&gt;
==Additional Steps==&lt;br /&gt;
*havent made there way into the script yet so doe these manually&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
	<entry>
		<id>https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2838</id>
		<title>CISN Display CentOS</title>
		<link rel="alternate" type="text/html" href="https://wiki-stadm.eri.ucsb.edu/index.php?title=CISN_Display_CentOS&amp;diff=2838"/>
		<updated>2015-12-14T22:49:08Z</updated>

		<summary type="html">&lt;p&gt;Stadm1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:CISN]]&lt;br /&gt;
==Introduction==&lt;br /&gt;
This page will attempt to document the creation of a kiosk type display of the CISN Display.  &lt;br /&gt;
The CISN Display software displays near real-time earthquake location information available via the network.&lt;br /&gt;
A complementary component would be a waveform viewer showing seismograms (in real time) from various locations around&lt;br /&gt;
California (or beyond), but we have not had time to mount a concerted effort along those lines yet.&lt;br /&gt;
==Historical Notes==&lt;br /&gt;
*http://wiki.eri.ucsb.edu/stadm/CISN_Display&lt;br /&gt;
=Installation Guide=&lt;/div&gt;</summary>
		<author><name>Stadm1</name></author>
		
	</entry>
</feed>