{"id":888,"date":"2018-03-20T13:35:31","date_gmt":"2018-03-20T11:35:31","guid":{"rendered":"https:\/\/helia.ee\/koolitus\/?page_id=888"},"modified":"2018-03-20T13:35:31","modified_gmt":"2018-03-20T11:35:31","slug":"create-active-directory-infrastructure-samba4-ubuntu","status":"publish","type":"page","link":"https:\/\/helia.ee\/koolitus\/?page_id=888","title":{"rendered":"Create an Active Directory Infrastructure with Samba4 on Ubuntu"},"content":{"rendered":"<h3>Step 1: Initial Configuration for Samba4<\/h3>\n<p><strong>1.<\/strong>\u00a0Before proceeding your\u00a0<strong>Samba4 AD DC<\/strong>\u00a0installation first let\u2019s run a few pre-required steps. First make sure the system is up to date with the last security features, kernels and packages by issuing the below command:<\/p>\n<pre>$ sudo apt-get update \r\n$ sudo apt-get upgrade\r\n$ sudo apt-get dist-upgrade\r\n<\/pre>\n<p><strong>2.<\/strong>\u00a0Next, open machine\u00a0<strong>\/etc\/fstab<\/strong>\u00a0file and assure that your partitions file system has\u00a0<strong>ACLs<\/strong>\u00a0enabled as illustrated on the below screenshot.<\/p>\n<p>Usually, common modern Linux file systems such as\u00a0<strong>ext3<\/strong>,\u00a0<strong>ext4<\/strong>,\u00a0<strong>xfs<\/strong>\u00a0or\u00a0<strong>btrfs<\/strong>\u00a0support and have ACLs enabled by default. If that\u2019s not the case with your file system just open\u00a0<strong>\/etc\/fstab<\/strong>\u00a0file for editing and add\u00a0<code>acl<\/code>\u00a0string at the end of third column and\u00a0<strong>reboot<\/strong>\u00a0the machine in order to apply changes.<\/p>\n<div id=\"attachment_23462\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Enable-ACL-on-Linux-Filesystem.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23462\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Enable-ACL-on-Linux-Filesystem.png\" sizes=\"auto, (max-width: 1029px) 100vw, 1029px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Enable-ACL-on-Linux-Filesystem.png 1029w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Enable-ACL-on-Linux-Filesystem-768x245.png 768w\" alt=\"Enable ACL's on Linux Filesystem\" width=\"1029\" height=\"328\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Enable ACL\u2019s on Linux Filesystem<\/p>\n<\/div>\n<p><strong>3.<\/strong>\u00a0Finally\u00a0<a href=\"https:\/\/www.tecmint.com\/set-hostname-permanently-in-linux\/\" target=\"_blank\" rel=\"noopener noreferrer\">setup your machine hostname<\/a>\u00a0with a descriptive name, such as\u00a0<code>adc1<\/code>\u00a0used in this example, by editing\u00a0<strong>\/etc\/hostname<\/strong>\u00a0file or by issuing.<\/p>\n<pre>$ sudo hostnamectl set-hostname adc1\r\n<\/pre>\n<p>A\u00a0<strong>reboot<\/strong>\u00a0is necessary after you\u2019ve changed your machine name in order to apply changes.<\/p>\n<h3>Step 2: Install Required Packages for Samba4 AD DC<\/h3>\n<p><strong>4.<\/strong>\u00a0In order to transform your server into an\u00a0<strong>Active Directory Domain Controller<\/strong>, install\u00a0<strong>Samba<\/strong>\u00a0and all the required packages on your machine by issuing the below command with\u00a0<strong>root<\/strong>\u00a0privileges in a console.<\/p>\n<pre>$ sudo apt-get install samba krb5-user krb5-config winbind libpam-winbind libnss-winbind\r\n<\/pre>\n<div id=\"attachment_23463\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Install-Samba-on-Ubuntu.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23463\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Install-Samba-on-Ubuntu.png\" sizes=\"auto, (max-width: 1110px) 100vw, 1110px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Install-Samba-on-Ubuntu.png 1110w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Install-Samba-on-Ubuntu-768x374.png 768w\" alt=\"Install Samba on Ubuntu\" width=\"1110\" height=\"541\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Install Samba on Ubuntu<\/p>\n<\/div>\n<p><strong>5.<\/strong>\u00a0While the installation is running a series of questions will be asked by the installer in order to configure the domain controller.<\/p>\n<p>On the first screen you will need to add a name for\u00a0<strong>Kerberos<\/strong>\u00a0default\u00a0<code>REALM<\/code>\u00a0in uppercase. Enter the name you will be using for your domain in uppercase and hit\u00a0<strong>Enter<\/strong>\u00a0to continue..<\/p>\n<div id=\"attachment_23464\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Configuring-Kerberos-Authentication.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23464\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Configuring-Kerberos-Authentication.png\" sizes=\"auto, (max-width: 1112px) 100vw, 1112px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Configuring-Kerberos-Authentication.png 1112w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Configuring-Kerberos-Authentication-768x200.png 768w\" alt=\"Configuring Kerberos Authentication\" width=\"1112\" height=\"289\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Configuring Kerberos Authentication<\/p>\n<\/div>\n<p><strong>6.<\/strong>\u00a0Next, enter the\u00a0<strong>hostname<\/strong>\u00a0of\u00a0<strong>Kerberos<\/strong>\u00a0server for your domain. Use the same name as for your domain, with lowercases this time and hit\u00a0<strong>Enter<\/strong>\u00a0to continue.<\/p>\n<div id=\"attachment_23465\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Set-Hostname-Kerberos-Server.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23465\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Set-Hostname-Kerberos-Server.png\" alt=\"Set Hostname Kerberos Server\" width=\"759\" height=\"265\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Set Hostname Kerberos Server<\/p>\n<\/div>\n<p><strong>7.<\/strong>\u00a0Finally, specify the\u00a0<strong>hostname<\/strong>\u00a0for the administrative server of your\u00a0<strong>Kerberos<\/strong>\u00a0realm. Use the same as your domain and hit\u00a0<strong>Enter<\/strong>\u00a0to finish the installation.<\/p>\n<div id=\"attachment_23466\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Set-Hostname-Administrative-Server.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23466\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Set-Hostname-Administrative-Server.png\" sizes=\"auto, (max-width: 778px) 100vw, 778px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Set-Hostname-Administrative-Server.png 778w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Set-Hostname-Administrative-Server-768x216.png 768w\" alt=\"Set Hostname Administrative Server\" width=\"778\" height=\"219\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Set Hostname Administrative Server<\/p>\n<\/div>\n<h3>Step 3: Provision Samba AD DC for Your Domain<\/h3>\n<p><strong>8.<\/strong>\u00a0Before starting to configure\u00a0<strong>Samba<\/strong>\u00a0for your domain, first run the below commands in order to stop and disable all samba daemons.<\/p>\n<pre>$ sudo systemctl stop samba-ad-dc.service smbd.service nmbd.service winbind.service\r\n$ sudo systemctl disable samba-ad-dc.service smbd.service nmbd.service winbind.service\r\n<\/pre>\n<p><strong>9.<\/strong>\u00a0Next, rename or remove samba original configuration. This step is absolutely required before provisioning\u00a0<strong>Samba AD<\/strong>\u00a0because at the provision time\u00a0<strong>Samba<\/strong>\u00a0will create a new configuration file from scratch and will throw up some errors in case it finds an old\u00a0<code>smb.conf<\/code>\u00a0file.<\/p>\n<pre>$ sudo mv \/etc\/samba\/smb.conf \/etc\/samba\/smb.conf.initial\r\n<\/pre>\n<p><strong>10.<\/strong>\u00a0Now, start the domain provisioning interactively by issuing the below command with root privileges and accept the default options that Samba provides you.<\/p>\n<p>Also, make sure you supply the IP address for a DNS forwarder at your premises (or external) and choose a strong password for Administrator account. If you choose a week password for Administrator account the domain provision will fail.<\/p>\n<pre>$ sudo samba-tool domain provision --use-rfc2307 --interactive\r\n<\/pre>\n<div id=\"attachment_23467\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Samba-Domain-Provisioning.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23467\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Samba-Domain-Provisioning.png\" sizes=\"auto, (max-width: 825px) 100vw, 825px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Samba-Domain-Provisioning.png 825w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Samba-Domain-Provisioning-768x718.png 768w\" alt=\"Samba Domain Provisioning\" width=\"825\" height=\"771\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Samba Domain Provisioning<\/p>\n<\/div>\n<p><strong>11.<\/strong>\u00a0Finally, rename or remove Kerberos main configuration file from\u00a0<strong>\/etc<\/strong>\u00a0directory and replace it using a symlink with Samba newly generated Kerberos file located in\u00a0<strong>\/var\/lib\/samba\/private<\/strong>\u00a0path by issuing the below commands:<\/p>\n<pre>$ sudo mv \/etc\/krb6.conf \/etc\/krb5.conf.initial\r\n$ sudo ln \u2013s \/var\/lib\/samba\/private\/krb5.conf \/etc\/\r\n<\/pre>\n<div id=\"attachment_23468\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Create-Kerberos-Configuration.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23468\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Create-Kerberos-Configuration.png\" sizes=\"auto, (max-width: 788px) 100vw, 788px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Create-Kerberos-Configuration.png 788w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Create-Kerberos-Configuration-768x163.png 768w\" alt=\"Create Kerberos Configuration\" width=\"788\" height=\"167\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Create Kerberos Configuration<\/p>\n<\/div>\n<p><strong>12.<\/strong>\u00a0Start and enable\u00a0<strong>Samba Active Directory Domain Controller<\/strong>\u00a0daemons.<\/p>\n<pre>$ sudo systemctl start samba-ad-dc.service\r\n$ sudo systemctl status samba-ad-dc.service\r\n$ sudo systemctl enable samba-ad-dc.service\r\n<\/pre>\n<div id=\"attachment_23469\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Enable-Samba-AD-DC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23469\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Enable-Samba-AD-DC.png\" sizes=\"auto, (max-width: 1090px) 100vw, 1090px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Enable-Samba-AD-DC.png 1090w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Enable-Samba-AD-DC-768x533.png 768w\" alt=\"Enable Samba Active Directory Domain Controller\" width=\"1090\" height=\"756\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Enable Samba Active Directory Domain Controller<\/p>\n<\/div>\n<p><strong>13.<\/strong>\u00a0Next,\u00a0<a href=\"https:\/\/www.tecmint.com\/20-netstat-commands-for-linux-network-management\/\" target=\"_blank\" rel=\"noopener noreferrer\">use netstat command<\/a>\u00a0in order to verify the list of all services required by an\u00a0<strong>Active Directory<\/strong>to run properly.<\/p>\n<pre>$ sudo netstat \u2013tulpn| egrep \u2018smbd|samba\u2019\r\n<\/pre>\n<div id=\"attachment_23470\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Verify-Samba-Active-Directory.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23470\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Verify-Samba-Active-Directory.png\" sizes=\"auto, (max-width: 932px) 100vw, 932px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Verify-Samba-Active-Directory.png 932w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Verify-Samba-Active-Directory-768x620.png 768w\" alt=\"Verify Samba Active Directory\" width=\"932\" height=\"753\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Verify Samba Active Directory<\/p>\n<\/div>\n<h3>Step 4: Final Samba Configurations<\/h3>\n<p><strong>14.<\/strong>\u00a0At this moment\u00a0<strong>Samba<\/strong>\u00a0should be fully operational at your premises. The highest domain level\u00a0<strong>Samba<\/strong>\u00a0is emulating should be\u00a0<strong>Windows AD DC 2008 R2<\/strong>.<\/p>\n<p>It can be verified with the help of\u00a0<strong>samba-tool<\/strong>\u00a0utility.<\/p>\n<pre>$ sudo samba-tool domain level show\r\n<\/pre>\n<div id=\"attachment_23471\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Verify-Samba-Domain-Level.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23471\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Verify-Samba-Domain-Level.png\" alt=\"Verify Samba Domain Level\" width=\"626\" height=\"207\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Verify Samba Domain Level<\/p>\n<\/div>\n<p><strong>15.<\/strong>\u00a0In order for\u00a0<strong>DNS<\/strong>\u00a0resolution to work locally, you need to open end edit network interface settings and point the DNS resolution by modifying\u00a0<strong>dns-nameservers<\/strong>\u00a0statement to the IP Address of your\u00a0<strong>Domain Controller<\/strong>\u00a0(use\u00a0<strong>127.0.0.1<\/strong>\u00a0for local DNS resolution) and\u00a0<strong>dns-search<\/strong>\u00a0statement to point to your\u00a0<strong>realm<\/strong>.<\/p>\n<pre>$ sudo cat \/etc\/network\/interfaces\r\n$ sudo cat \/etc\/resolv.conf\r\n<\/pre>\n<div id=\"attachment_23472\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Configure-DNS-for-Samba-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23472\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Configure-DNS-for-Samba-AD.png\" alt=\"Configure DNS for Samba AD\" width=\"746\" height=\"513\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Configure DNS for Samba AD<\/p>\n<\/div>\n<p>When finished,\u00a0<strong>reboot<\/strong>\u00a0your server and take a look at your resolver file to make sure it points back to the right DNS name servers.<\/p>\n<p><strong>16.<\/strong>\u00a0Finally, test the DNS resolver by issuing queries and pings against some\u00a0<strong>AD DC<\/strong>\u00a0crucial records, as in the below excerpt. Replace the domain name accordingly.<\/p>\n<pre>$ ping \u2013c3 tecmint.lan       <strong>#Domain Name<\/strong>\r\n$ ping \u2013c3 adc1.tecmint.lan  <strong>#FQDN<\/strong>\r\n$ ping \u2013c3 adc1              <strong>#Host<\/strong>\r\n<\/pre>\n<div id=\"attachment_23473\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Samba-AD-DNS-Records.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23473\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Samba-AD-DNS-Records.png\" alt=\"Check Samba AD DNS Records\" width=\"766\" height=\"573\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Check Samba AD DNS Records<\/p>\n<\/div>\n<p>Run following few queries against Samba Active Directory Domain Controller..<\/p>\n<pre>$ host \u2013t A tecmint.lan\r\n$ host \u2013t A adc1.tecmint.lan\r\n$ host \u2013t SRV _kerberos._udp.tecmint.lan  # UDP Kerberos SRV record\r\n$ host -t SRV _ldap._tcp.tecmint.lan # TCP LDAP SRV record\r\n<\/pre>\n<p><strong>17.<\/strong>\u00a0Also, verify\u00a0<strong>Kerberos<\/strong>\u00a0authentication by requesting a ticket for the domain administrator account and list the cached ticket. Write the domain name portion with uppercase.<\/p>\n<pre>$ kinit administrator@TECMINT.LAN\r\n$ klist\r\n<\/pre>\n<div id=\"attachment_23474\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Kerberos-Authentication-on-Domain.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23474\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Kerberos-Authentication-on-Domain.png\" alt=\"Check Kerberos Authentication on Domain\" width=\"738\" height=\"274\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Check Kerberos Authentication on Domain<\/p>\n<\/div>\n<p>That\u2019s all! Now you have a fully operational\u00a0<strong>AD Domain Controller<\/strong>\u00a0installed in your network and you can start integrate\u00a0<strong>Windows<\/strong>\u00a0or\u00a0<strong>Linux<\/strong>\u00a0machines into\u00a0<strong>Samba AD<\/strong>.<\/p>\n<p>On the next series we\u2019ll cover other\u00a0<strong>Samba AD<\/strong>\u00a0topics, such as how to manage you\u2019re the domain controller from Samba command line, how to integrate Windows 10 into the domain name and manage Samba AD remotely using RSAT and other important topics.<\/p>\n<h3>Step 1: Manage Samba AD DC from Command Line<\/h3>\n<p><strong>1.<\/strong>\u00a0<strong>Samba AD DC<\/strong>\u00a0can be managed through\u00a0<strong>samba-tool<\/strong>\u00a0command line utility which offers a great interface for administrating your domain.<\/p>\n<p>With the help of samba-tool interface you can directly manage domain users and groups, domain Group Policy, domain sites, DNS services, domain replication and other critical domain functions.<\/p>\n<p><center><ins class=\"adsbygoogle\" data-ad-client=\"ca-pub-2601749019656699\" data-ad-slot=\"5590002574\" data-ad-format=\"auto\" data-adsbygoogle-status=\"done\"><ins id=\"aswift_3_expand\"><ins id=\"aswift_3_anchor\"><iframe id=\"aswift_3\" name=\"aswift_3\" width=\"710\" height=\"66\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" allowfullscreen=\"allowfullscreen\" data-mce-fragment=\"1\"><\/iframe><\/ins><\/ins><\/ins><\/center>To review the entire functionality of samba-tool just type the command with root privileges without any option or parameter.<\/p>\n<pre># samba-tool -h\r\n<\/pre>\n<div id=\"attachment_23483\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Samba-Administration-Tool.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23483\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Samba-Administration-Tool.png\" sizes=\"auto, (max-width: 808px) 100vw, 808px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Samba-Administration-Tool.png 808w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Samba-Administration-Tool-768x571.png 768w\" alt=\"samba-tool - Manage Samba Administration Tool\" width=\"808\" height=\"601\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">samba-tool \u2013 Manage Samba Administration Tool<\/p>\n<\/div>\n<p><strong>2.<\/strong>\u00a0Now, let\u2019s start using\u00a0<strong>samba-tool<\/strong>\u00a0utility to administer\u00a0<strong>Samba4 Active Directory<\/strong>\u00a0and manage our users.<\/p>\n<p>In order to create a user on AD use the following command:<\/p>\n<pre># samba-tool user add your_domain_user\r\n<\/pre>\n<p>To add a user with several important fields required by AD, use the following syntax:<\/p>\n<pre><strong>--------- review all options ---------<\/strong> \r\n# samba-tool user add -h  \r\n# samba-tool user add your_domain_user --given-name=your_name --surname=your_username --mail-address=your_domain_user@tecmint.lan --login-shell=\/bin\/bash\r\n<\/pre>\n<div id=\"attachment_23484\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Create-User-on-Samba-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23484\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Create-User-on-Samba-AD.png\" sizes=\"auto, (max-width: 896px) 100vw, 896px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Create-User-on-Samba-AD.png 896w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Create-User-on-Samba-AD-768x167.png 768w\" alt=\"Create User on Samba AD\" width=\"896\" height=\"195\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Create User on Samba AD<\/p>\n<\/div>\n<p><strong>3.<\/strong>\u00a0A listing of all samba AD domain users can be obtained by issuing the following command:<\/p>\n<pre># samba-tool user list\r\n<\/pre>\n<div id=\"attachment_23485\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/List-Samba-AD-Users.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23485\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/List-Samba-AD-Users.png\" sizes=\"auto, (max-width: 836px) 100vw, 836px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/List-Samba-AD-Users.png 836w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/List-Samba-AD-Users-768x705.png 768w\" alt=\"List Samba AD Users\" width=\"836\" height=\"767\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">List Samba AD Users<\/p>\n<\/div>\n<p><strong>4.<\/strong>\u00a0To delete a\u00a0<strong>samba AD domain user<\/strong>\u00a0use the below syntax:<\/p>\n<pre># samba-tool user delete your_domain_user\r\n<\/pre>\n<p><strong>5.<\/strong>\u00a0Reset a samba domain user password by executing the below command:<\/p>\n<pre># samba-tool user setpassword your_domain_user\r\n<\/pre>\n<p><strong>6.<\/strong>\u00a0In order to disable or enable an samba AD User account use the below command:<\/p>\n<pre># samba-tool user disable your_domain_user\r\n# samba-tool user enable your_domain_user\r\n<\/pre>\n<p><strong>7.<\/strong>\u00a0Likewise, samba groups can be managed with the following command syntax:<\/p>\n<pre><strong>--------- review all options ---------<\/strong> \r\n# samba-tool group add \u2013h  \r\n# samba-tool group add your_domain_group\r\n<\/pre>\n<p><strong>8.<\/strong>\u00a0Delete a samba domain group by issuing the below command:<\/p>\n<pre># samba-tool group delete your_domain_group\r\n<\/pre>\n<p><strong>9.<\/strong>\u00a0To display all samba domain groups run the following command:<\/p>\n<pre># samba-tool group list\r\n<\/pre>\n<p><strong>10.<\/strong>\u00a0To list all the samba domain members in a specific group use the command:<\/p>\n<pre># samba-tool group listmembers \"your_domain group\"\r\n<\/pre>\n<div id=\"attachment_23487\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/List-Samba-Domain-Members-of-Group.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23487\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/List-Samba-Domain-Members-of-Group.png\" alt=\"List Samba Domain Members of Group\" width=\"695\" height=\"194\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">List Samba Domain Members of Group<\/p>\n<\/div>\n<p><strong>11.<\/strong>\u00a0Adding\/Removing a member from a samba domain group can be done by issuing one of the following commands:<\/p>\n<pre># samba-tool group addmembers your_domain_group your_domain_user\r\n# samba-tool group remove members your_domain_group your_domain_user\r\n<\/pre>\n<p><strong>12.<\/strong>\u00a0As mentioned earlier, samba-tool command line interface can also be used to manage your samba domain policy and security.<\/p>\n<p>To review your samba domain password settings use the below command:<\/p>\n<pre># samba-tool domain passwordsettings show\r\n<\/pre>\n<div id=\"attachment_23488\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Samba-Domain-Password.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23488\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Samba-Domain-Password.png\" alt=\"Check Samba Domain Password\" width=\"531\" height=\"325\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Check Samba Domain Password<\/p>\n<\/div>\n<p><strong>13.<\/strong>\u00a0In order to modify samba domain password policy, such as the password complexity level, password ageing, length, how many old password to remember and other security features required for a Domain Controller use the below screenshot as a guide.<\/p>\n<pre><strong>---------- List all command options ----------<\/strong> \r\n# samba-tool domain passwordsettings -h \r\n<\/pre>\n<div id=\"attachment_23489\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Manage-Samba-Domain-Password-Settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23489\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Manage-Samba-Domain-Password-Settings.png\" alt=\"Manage Samba Domain Password Settings\" width=\"730\" height=\"262\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Manage Samba Domain Password Settings<\/p>\n<\/div>\n<p>Never use the password policy rules as illustrated above on a production environment. The above settings are used just for demonstration purposes.<\/p>\n<h3>Step 2: Samba Local Authentication Using Active Directory Accounts<\/h3>\n<p><strong>14.<\/strong>\u00a0By default, AD users cannot perform local logins on the Linux system outside\u00a0<strong>Samba AD DC<\/strong>environment.<\/p>\n<p>In order to login on the system with an\u00a0<strong>Active Directory<\/strong>\u00a0account you need to make the following changes on your Linux system environment and modify Samba4 AD DC.<\/p>\n<p>First, open samba main configuration file and add the below lines, if missing, as illustrated on the below screenshot.<\/p>\n<pre>$ sudo nano \/etc\/samba\/smb.conf\r\n<\/pre>\n<p>Make sure the following statements appear on the configuration file:<\/p>\n<pre>winbind enum users = yes\r\nwinbind enum groups = yes\r\n<\/pre>\n<div id=\"attachment_23490\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Samba-Authentication-Using-Active-Directory-Accounts.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23490\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Samba-Authentication-Using-Active-Directory-Accounts.png\" alt=\"Samba Authentication Using Active Directory User Accounts\" width=\"741\" height=\"513\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Samba Authentication Using Active Directory User Accounts<\/p>\n<\/div>\n<p><strong>15.<\/strong>\u00a0After you\u2019ve made the changes, use\u00a0<strong>testparm<\/strong>\u00a0utility to make sure no errors are found on samba configuration file and restart samba daemons by issuing the below command.<\/p>\n<pre>$ testparm\r\n$ sudo systemctl restart samba-ad-dc.service\r\n<\/pre>\n<div id=\"attachment_23491\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Samba-Configuration-for-Errors.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23491\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Samba-Configuration-for-Errors.png\" alt=\"Check Samba Configuration for Errors\" width=\"725\" height=\"166\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Check Samba Configuration for Errors<\/p>\n<\/div>\n<p><strong>16.<\/strong>\u00a0Next, we need to modify local PAM configuration files in order for\u00a0<strong>Samba4 Active Directory<\/strong>accounts to be able to authenticate and open a session on the local system and create a home directory for users at first login.<\/p>\n<p>Use the\u00a0<strong>pam-auth-update<\/strong>\u00a0command to open PAM configuration prompt and make sure you enable all PAM profiles using\u00a0<code>[space]<\/code>\u00a0key as illustrated on the below screenshot.<\/p>\n<p>When finished hit\u00a0<code>[Tab]<\/code>\u00a0key to move to\u00a0<strong>Ok<\/strong>\u00a0and apply changes.<\/p>\n<pre>$ sudo pam-auth-update\r\n<\/pre>\n<div id=\"attachment_23492\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/PAM-Configuration-for-Samba4-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23492\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/PAM-Configuration-for-Samba4-AD.png\" alt=\"Configure PAM for Samba4 AD\" width=\"408\" height=\"124\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Configure PAM for Samba4 AD<\/p>\n<\/div>\n<div id=\"attachment_23493\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Enable-PAM-Authentication-Module-for-Samba4-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23493\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Enable-PAM-Authentication-Module-for-Samba4-AD.png\" sizes=\"auto, (max-width: 1083px) 100vw, 1083px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Enable-PAM-Authentication-Module-for-Samba4-AD.png 1083w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Enable-PAM-Authentication-Module-for-Samba4-AD-768x275.png 768w\" alt=\"Enable PAM Authentication Module for Samba4 AD Users\" width=\"1083\" height=\"388\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Enable PAM Authentication Module for Samba4 AD Users<\/p>\n<\/div>\n<p><strong>17.<\/strong>\u00a0Now, open\u00a0<strong>\/etc\/nsswitch.conf<\/strong>\u00a0file with a text editor and add\u00a0<strong>winbind statement<\/strong>\u00a0at the end of the password and group lines as illustrated on the below screenshot.<\/p>\n<pre>$ sudo vi \/etc\/nsswitch.conf\r\n<\/pre>\n<div id=\"attachment_23494\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Add-Windbind-Service-Switch-for-Samba.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23494\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Add-Windbind-Service-Switch-for-Samba.png\" alt=\"Add Windbind Service Switch for Samba\" width=\"701\" height=\"431\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Add Windbind Service Switch for Samba<\/p>\n<\/div>\n<p><strong>18.<\/strong>\u00a0Finally, edit\u00a0<strong>\/etc\/pam.d\/common-password<\/strong>\u00a0file, search for the below line as illustrated on the below screenshot and remove the\u00a0<strong>use_authtok<\/strong>\u00a0statement.<\/p>\n<p>This setting assures that Active Directory users can change their password from command line while authenticated in Linux. With this setting on, AD users authenticated locally on Linux cannot change their password from console.<\/p>\n<pre>password       [success=1 default=ignore]      pam_winbind.so try_first_pass\r\n<\/pre>\n<div id=\"attachment_23495\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Allow-Samba-AD-Users-to-Change-Password.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23495\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Allow-Samba-AD-Users-to-Change-Password.png\" sizes=\"auto, (max-width: 913px) 100vw, 913px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Allow-Samba-AD-Users-to-Change-Password.png 913w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Allow-Samba-AD-Users-to-Change-Password-768x476.png 768w\" alt=\"Allow Samba AD Users to Change Passwords\" width=\"913\" height=\"566\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Allow Samba AD Users to Change Passwords<\/p>\n<\/div>\n<p>Remove\u00a0<strong>use_authtok<\/strong>\u00a0option each time PAM updates are installed and applied to PAM modules or each time you execute\u00a0<strong>pam-auth-update<\/strong>\u00a0command.<\/p>\n<p><strong>19.<\/strong>\u00a0Samba4 binaries comes with a\u00a0<strong>winbindd<\/strong>\u00a0daemon built-in and enabled by default.<\/p>\n<p>For this reason you\u2019re no longer required to separately enable and run\u00a0<strong>winbind<\/strong>\u00a0daemon provided by\u00a0<strong>winbind<\/strong>\u00a0package from official Ubuntu repositories.<\/p>\n<p>In case the old and deprecated\u00a0<strong>winbind<\/strong>\u00a0service is started on the system make sure you disable it and stop the service by issuing the below commands:<\/p>\n<pre>$ sudo systemctl disable winbind.service\r\n$ sudo systemctl stop winbind.service\r\n<\/pre>\n<p>Although, we no longer need to run old winbind daemon, we still need to install Winbind package from repositories in order to install and use\u00a0<strong>wbinfo<\/strong>\u00a0tool.<\/p>\n<p><strong>Wbinfo<\/strong>\u00a0utility can be used to query Active Directory users and groups from\u00a0<strong>winbindd<\/strong>\u00a0daemon point of view.<\/p>\n<p>The following commands illustrates how to query AD users and groups using\u00a0<strong>wbinfo<\/strong>.<\/p>\n<pre>$ wbinfo -g\r\n$ wbinfo -u\r\n$ wbinfo -i your_domain_user\r\n<\/pre>\n<div id=\"attachment_23497\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Information-of-Samba4-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23497\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Information-of-Samba4-AD.png\" alt=\"Check Samba4 AD Information \" width=\"677\" height=\"423\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Check Samba4 AD Information<\/p>\n<\/div>\n<div id=\"attachment_23496\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Samba4-AD-User-Info.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23496\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Samba4-AD-User-Info.png\" alt=\"Check Samba4 AD User Info\" width=\"620\" height=\"50\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Check Samba4 AD User Info<\/p>\n<\/div>\n<p><strong>20.<\/strong>\u00a0Apart from\u00a0<strong>wbinfo<\/strong>\u00a0utility you can also use\u00a0<strong>getent<\/strong>\u00a0command line utility to query Active Directory database from Name Service Switch libraries which are represented in\u00a0<strong>\/etc\/nsswitch.conf<\/strong>\u00a0file.<\/p>\n<p>Pipe\u00a0<strong>getent<\/strong>\u00a0command through a\u00a0<strong>grep<\/strong>\u00a0filter in order to narrow the results regarding just your AD realm user or group database.<\/p>\n<pre># getent passwd | grep TECMINT\r\n# getent group | grep TECMINT\r\n<\/pre>\n<div id=\"attachment_23498\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Get-Samba4-AD-Details.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23498\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Get-Samba4-AD-Details.png\" alt=\"Get Samba4 AD Details\" width=\"708\" height=\"559\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Get Samba4 AD Details<\/p>\n<\/div>\n<h3>Step 3: Login in Linux with an Active Directory User<\/h3>\n<p><strong>21.<\/strong>\u00a0In order to authenticate on the system with a\u00a0<strong>Samba4 AD<\/strong>\u00a0user, just use the\u00a0<strong>AD username<\/strong>parameter after\u00a0<code>su -<\/code>\u00a0command.<\/p>\n<p>At the first login a message will be displayed on the console which notifies you that a home directory has been created on\u00a0<code>\/home\/$DOMAIN\/<\/code>\u00a0system path with the mane of your AD username.<\/p>\n<p>Use\u00a0<strong>id command<\/strong>\u00a0to display extra information about the authenticated user.<\/p>\n<pre># su - your_ad_user\r\n$ id\r\n$ exit\r\n<\/pre>\n<div id=\"attachment_23500\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Samba4-AD-User-Authentication-on-Linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23500\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Samba4-AD-User-Authentication-on-Linux.png\" sizes=\"auto, (max-width: 894px) 100vw, 894px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Samba4-AD-User-Authentication-on-Linux.png 894w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Check-Samba4-AD-User-Authentication-on-Linux-768x207.png 768w\" alt=\"Check Samba4 AD User Authentication on Linux\" width=\"894\" height=\"241\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Check Samba4 AD User Authentication on Linux<\/p>\n<\/div>\n<p><strong>22.<\/strong>\u00a0To change the password for an authenticated AD user type\u00a0<strong>passwd command<\/strong>\u00a0in console after you have successfully logged into the system.<\/p>\n<pre>$ su - your_ad_user\r\n$ passwd\r\n<\/pre>\n<div id=\"attachment_23501\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Change-Samba4-AD-User-Password.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23501\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Change-Samba4-AD-User-Password.png\" alt=\"Change Samba4 AD User Password\" width=\"494\" height=\"173\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Change Samba4 AD User Password<\/p>\n<\/div>\n<p><strong>23.<\/strong>\u00a0By default,\u00a0<strong>Active Directory<\/strong>\u00a0users are not granted with root privileges in order to perform administrative tasks on Linux.<\/p>\n<p>To grant root powers to an AD user you must add the username to the local\u00a0<strong>sudo<\/strong>\u00a0group by issuing the below command.<\/p>\n<p>Make sure you enclose the\u00a0<strong>realm<\/strong>,\u00a0<strong>slash<\/strong>\u00a0and\u00a0<strong>AD username<\/strong>\u00a0with single\u00a0<strong>ASCII<\/strong>\u00a0quotes.<\/p>\n<pre># usermod -aG sudo 'DOMAIN\\your_domain_user'\r\n<\/pre>\n<p>To test if AD user has root privileges on the local system, login and run a command, such as\u00a0<strong>apt-get update<\/strong>, with sudo permissions.<\/p>\n<pre># su - tecmint_user\r\n$ sudo apt-get update\r\n<\/pre>\n<div id=\"attachment_23502\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Grant-sudo-Permission-to-Samba4-AD-User.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23502\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Grant-sudo-Permission-to-Samba4-AD-User.png\" alt=\"Grant sudo Permission to Samba4 AD User\" width=\"673\" height=\"264\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Grant sudo Permission to Samba4 AD User<\/p>\n<\/div>\n<p><strong>24.<\/strong>\u00a0In case you want to add root privileges for all accounts of an Active Directory group, edit\u00a0<strong>\/etc\/sudoers<\/strong>\u00a0file using\u00a0<strong>visudo<\/strong>\u00a0command and add the below line after root privileges line, as illustrated on the below screenshot:<\/p>\n<pre>%DOMAIN\\\\your_domain\\  group ALL=(ALL:ALL) ALL\r\n<\/pre>\n<p>Pay attention to\u00a0<strong>sudoers<\/strong>\u00a0syntax so you don\u2019t break things out.<\/p>\n<p>Sudoers file doesn\u2019t handles very well the use of\u00a0<strong>ASCII<\/strong>\u00a0quotation marks, so make sure you use\u00a0<code>%<\/code>\u00a0to denote that you\u2019re referring to a group and use a backslash to escape the first slash after the domain name and another backslash to escape spaces if your group name contains spaces (most of AD built-in groups contain spaces by default). Also, write the realm with uppercases.<\/p>\n<div id=\"attachment_23503\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Give-Sudo-Access-to-All-Samba4-AD-Users.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23503\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Give-Sudo-Access-to-All-Samba4-AD-Users.png\" sizes=\"auto, (max-width: 870px) 100vw, 870px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Give-Sudo-Access-to-All-Samba4-AD-Users.png 870w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Give-Sudo-Access-to-All-Samba4-AD-Users-768x557.png 768w\" alt=\"Give Sudo Access to All Samba4 AD Users\" width=\"870\" height=\"631\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Give Sudo Access to All Samba4 AD Users<\/p>\n<\/div>\n<p>That\u2019s all for now!\u00a0<strong>Managing Samba4 AD<\/strong>\u00a0infrastructure can be also achieved with several tools from Windows environment, such as\u00a0<strong>ADUC<\/strong>,\u00a0<strong>DNS Manager<\/strong>,\u00a0<strong>GPM<\/strong>\u00a0or other, which can be obtained by installing\u00a0<strong>RSAT<\/strong>\u00a0package from Microsoft download page.<\/p>\n<p>To administer\u00a0<strong>Samba4 AD DC<\/strong>\u00a0through\u00a0<strong>RSAT<\/strong>\u00a0utilities, it\u2019s absolutely necessary to join the Windows system into\u00a0<strong>Samba4 Active Directory<\/strong>. This will be the subject of our next tutorial, till then stay tuned to\u00a0<strong>TecMint<\/strong>.<\/p>\n<h1 class=\"post-title\">Manage Samba4 Active Directory Infrastructure from Windows10 via RSAT \u2013 Part 3<\/h1>\n<p class=\"post-byline\">by\u00a0<a title=\"Posts by Matei Cezar\" href=\"https:\/\/www.tecmint.com\/author\/cezarmatei\/\" rel=\"author\">Matei Cezar<\/a>\u00a0| Published: December 5, 2016 | Last Updated: December 7, 2016<\/p>\n<div class=\"clear\"><\/div>\n<div class=\"add-box\"><ins class=\"adsbygoogle\" data-ad-client=\"ca-pub-2601749019656699\" data-ad-slot=\"1986283779\" data-adsbygoogle-status=\"done\"><ins id=\"aswift_1_expand\"><ins id=\"aswift_1_anchor\"><iframe id=\"aswift_1\" name=\"aswift_1\" width=\"468\" height=\"15\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" allowfullscreen=\"allowfullscreen\" data-mce-fragment=\"1\"><\/iframe><\/ins><\/ins><\/ins><\/div>\n<div class=\"clear\"><\/div>\n<div id=\"exam_announcement\"><i class=\"fa fa-book\"><\/i>\u00a0<b>Download Your Free eBooks NOW<\/b>\u00a0&#8211;\u00a0<a href=\"https:\/\/www.tecmint.com\/10-useful-free-linux-ebooks-for-newbies-and-administrators\/\" target=\"_blank\" rel=\"noopener\">10 Free Linux eBooks for Administrators<\/a>\u00a0|\u00a0<a href=\"https:\/\/www.tecmint.com\/free-linux-shell-scripting-books\/\" target=\"_blank\" rel=\"noopener\">4 Free Shell Scripting eBooks<\/a><\/div>\n<div class=\"clear\"><\/div>\n<div class=\"clear\"><\/div>\n<div class=\"entry share\">\n<div class=\"entry-inner\">\n<p>In this part of the\u00a0<a href=\"https:\/\/www.tecmint.com\/category\/samba4-active-directory\/\" target=\"_blank\" rel=\"noopener\">Samba4 AD DC infrastructure series<\/a>\u00a0we will talk on how join a\u00a0<strong>Windows 10<\/strong>\u00a0machine into a\u00a0<strong>Samba4<\/strong>\u00a0realm and how to administer the domain from a\u00a0<strong>Windows 10<\/strong>\u00a0workstation.<\/p>\n<p>Once a\u00a0<strong>Windows 10<\/strong>\u00a0system has been joined to\u00a0<strong>Samba4 AD DC<\/strong>\u00a0we can create, remove or disable domain users and groups, we can create new\u00a0<strong>Organizational Units<\/strong>, we can create, edit and manage domain policy or we can manage Samba4 domain DNS service.<\/p>\n<p>All of the above functions and other complex tasks concerning domain administration can be achieved via any modern Windows platform with the help of\u00a0<strong>RSAT \u2013 Microsoft Remote Server Administration Tools<\/strong>.<\/p>\n<h4>Requirements<\/h4>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/install-samba4-active-directory-ubuntu\/\" target=\"_blank\" rel=\"noopener\">Create an AD Infrastructure with Samba4 on Ubuntu 16.04 \u2013 Part 1<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/manage-samba4-active-directory-linux-command-line\/\" target=\"_blank\" rel=\"noopener\">Manage Samba4 AD Infrastructure from Linux Command Line \u2013 Part 2<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/manage-samba4-dns-group-policy-from-windows\/\">Manage Samba4 AD Domain Controller DNS and Group Policy from Windows \u2013 Part 4<\/a><\/li>\n<\/ol>\n<h3>Step 1: Configure Domain Time Synchronization<\/h3>\n<p><strong>1.<\/strong>\u00a0Before starting to administer\u00a0<strong>Samba4 ADDC<\/strong>\u00a0from\u00a0<strong>Windows 10<\/strong>\u00a0with the help of\u00a0<strong>RSAT<\/strong>\u00a0tools, we need to know and take care of a crucial piece of service required for an\u00a0<strong>Active Directory<\/strong>\u00a0and this service refers to\u00a0<a href=\"https:\/\/www.tecmint.com\/how-to-synchronize-time-with-ntp-server-in-ubuntu-linux-mint-xubuntu-debian\/\" target=\"_blank\" rel=\"noopener\">accurate time synchronization<\/a>.<\/p>\n<p>Time synchronization can be offered by\u00a0<strong>NTP<\/strong>\u00a0daemon in most of the Linux distributions. The default maximum time period discrepancy an AD can support is about\u00a0<strong>5<\/strong>\u00a0minutes.<\/p>\n<p>If the divergence time period is greater than\u00a0<strong>5<\/strong>\u00a0minutes you should start experience various errors, most important concerning AD users, joined machines or share access.<\/p>\n<p>To install\u00a0<strong>Network Time Protocol<\/strong>\u00a0daemon and\u00a0<strong>NTP<\/strong>\u00a0client utility in\u00a0<strong>Ubuntu<\/strong>, execute the below command.<\/p>\n<pre>$ sudo apt-get install ntp ntpdate\r\n<\/pre>\n<div id=\"attachment_23685\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Install-NTP-on-Ubuntu.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23685\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Install-NTP-on-Ubuntu.png\" sizes=\"auto, (max-width: 779px) 100vw, 779px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Install-NTP-on-Ubuntu.png 779w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Install-NTP-on-Ubuntu-768x245.png 768w\" alt=\"Install NTP on Ubuntu\" width=\"779\" height=\"249\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Install NTP on Ubuntu<\/p>\n<\/div>\n<p><strong>2.<\/strong>\u00a0Next, open and edit NTP configuration file and replace the default NTP pool server list with a new list of NTP servers which are geographically located near your current physical equipment location.<\/p>\n<p>The list of NTP servers can be obtained by visiting official NTP Pool Project webpage\u00a0<a href=\"http:\/\/www.pool.ntp.org\/en\/\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/www.pool.ntp.org\/en\/<\/a>.<\/p>\n<pre>$ sudo nano \/etc\/ntp.conf\r\n<\/pre>\n<p>Comment the default server list by adding a\u00a0<code>#<\/code>\u00a0in front of each pool line and add the below pool lines with your proper NTP servers as illustrated on the below screenshot.<\/p>\n<pre>pool 0.ro.pool.ntp.org iburst\r\npool 1.ro.pool.ntp.org iburst\r\npool 2.ro.pool.ntp.org iburst\r\n# Use Ubuntu's ntp server as a fallback.\r\npool 3.ro.pool.ntp.org\r\n<\/pre>\n<div id=\"attachment_23686\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Configure-NTP-Server-in-Ubuntu.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23686\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Configure-NTP-Server-in-Ubuntu.png\" alt=\"Configure NTP Server in Ubuntu\" width=\"606\" height=\"550\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Configure NTP Server in Ubuntu<\/p>\n<\/div>\n<p><strong>3.<\/strong>\u00a0Now, don\u2019t close the file yet. Move to the top at the file and add the below line after the driftfile statement. This setup allows the clients to query the server using AD signed NTP requests.<\/p>\n<pre>ntpsigndsocket \/var\/lib\/samba\/ntp_signd\/\r\n<\/pre>\n<div id=\"attachment_23688\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Sync-AD-with-NTP.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23688\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Sync-AD-with-NTP.png\" alt=\"Sync AD with NTP\" width=\"620\" height=\"458\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Sync AD with NTP<\/p>\n<\/div>\n<p><strong>4.<\/strong>\u00a0Finally, move to the bottom of the file and add the below line, as illustrated on the below screenshot, which will allow network clients only to query the time on the server.<\/p>\n<pre>restrict default kod nomodify notrap nopeer mssntp\r\n<\/pre>\n<div id=\"attachment_23689\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Query-Client-to-NTP-Server.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23689\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Query-Client-to-NTP-Server.png\" alt=\"Query Clients to NTP Server\" width=\"637\" height=\"548\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Query Clients to NTP Server<\/p>\n<\/div>\n<p><strong>5.<\/strong>\u00a0When finished, save and close the NTP configuration file and grant NTP service with the proper permissions in order to read the ntp_signed directory.<\/p>\n<p>This is the system path where\u00a0<strong>Samba NTP<\/strong>\u00a0socket is located. Afterwards, restart NTP daemon to apply changes and verify if NTP has open sockets in your system network table using\u00a0<a href=\"https:\/\/www.tecmint.com\/20-netstat-commands-for-linux-network-management\/\" target=\"_blank\" rel=\"noopener\">netstat command<\/a>combined with\u00a0<a href=\"https:\/\/www.tecmint.com\/12-practical-examples-of-linux-grep-command\/\" target=\"_blank\" rel=\"noopener\">grep filter<\/a>.<\/p>\n<pre>$ sudo chown root:ntp \/var\/lib\/samba\/ntp_signd\/\r\n$ sudo chmod 750 \/var\/lib\/samba\/ntp_signd\/\r\n$ sudo systemctl restart ntp\r\n$ sudo netstat \u2013tulpn | grep ntp\r\n<\/pre>\n<div id=\"attachment_23690\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Grant-Permission-to-NTP.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23690\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Grant-Permission-to-NTP.png\" sizes=\"auto, (max-width: 864px) 100vw, 864px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Grant-Permission-to-NTP.png 864w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Grant-Permission-to-NTP-768x268.png 768w\" alt=\"Grant Permission to NTP\" width=\"864\" height=\"301\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Grant Permission to NTP<\/p>\n<\/div>\n<p>Use the\u00a0<strong>ntpq<\/strong>\u00a0command line utility to monitor NTP daemon along with the\u00a0<code>-p<\/code>\u00a0flag in order to print a summary of peers state.<\/p>\n<pre>$ ntpq -p\r\n<\/pre>\n<div id=\"attachment_23691\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Monitor-NTP-Server-Pool.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23691\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Monitor-NTP-Server-Pool.png\" alt=\"Monitor NTP Server Pool\" width=\"761\" height=\"341\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Monitor NTP Server Pool<\/p>\n<\/div>\n<h3>Step 2: Troubleshoot NTP Time Issues<\/h3>\n<p><strong>6.<\/strong>\u00a0Sometimes the NTP daemon gets stuck in calculations while trying to synchronize time with an upstream ntp server peer, resulting the following error messages when manually trying to force time synchronization by running\u00a0<strong>ntpdate<\/strong>\u00a0utility on a client side:<\/p>\n<pre># ntpdate -qu adc1\r\n<strong>ntpdate[4472]: no server suitable for synchronization found<\/strong><\/pre>\n<div id=\"attachment_23693\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/NTP-Time-Synchronization-Error.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23693\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/NTP-Time-Synchronization-Error.png\" alt=\"NTP Time Synchronization Error\" width=\"709\" height=\"207\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">NTP Time Synchronization Error<\/p>\n<\/div>\n<p>when using\u00a0<strong>ntpdate<\/strong>\u00a0command with\u00a0<code>-d<\/code>\u00a0flag.<\/p>\n<pre># ntpdate -d adc1.tecmint.lan\r\n<strong>Server dropped: Leap not in sync<\/strong><\/pre>\n<div id=\"attachment_23694\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/NTP-Server-Dropped-Leap-Not-Sync.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23694\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/NTP-Server-Dropped-Leap-Not-Sync.png\" sizes=\"auto, (max-width: 777px) 100vw, 777px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/NTP-Server-Dropped-Leap-Not-Sync.png 777w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/NTP-Server-Dropped-Leap-Not-Sync-768x515.png 768w\" alt=\"NTP Server Dropped Leap Not in Sync\" width=\"777\" height=\"521\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">NTP Server Dropped Leap Not in Sync<\/p>\n<\/div>\n<p><strong>7.<\/strong>\u00a0To circumvent this issue, use the following trick to solve the problem: On the server, stop the NTP service and use the\u00a0<strong>ntpdate<\/strong>\u00a0client utility to manually force time synchronization with an external peer using the\u00a0<code>-b<\/code>\u00a0flag as shown below:<\/p>\n<pre># systemctl stop ntp.service\r\n<strong># ntpdate -b 2.ro.pool.ntp.org<\/strong>  [<strong>your_ntp_peer<\/strong>]\r\n# systemctl start ntp.service\r\n# systemctl status ntp.service\r\n<\/pre>\n<div id=\"attachment_23695\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Force-NTP-Time-Synchronization.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23695\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Force-NTP-Time-Synchronization.png\" sizes=\"auto, (max-width: 779px) 100vw, 779px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Force-NTP-Time-Synchronization.png 779w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Force-NTP-Time-Synchronization-768x494.png 768w\" alt=\"Force NTP Time Synchronization\" width=\"779\" height=\"501\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Force NTP Time Synchronization<\/p>\n<\/div>\n<p><strong>8.<\/strong>\u00a0After the time has been accurately synchronized, start the NTP daemon on the server and verify from the client side if the service is ready to serve time for local clients by issuing the following command:<\/p>\n<pre># ntpdate -du adc1.tecmint.lan    [<strong>your_adc_server<\/strong>]\r\n<\/pre>\n<div id=\"attachment_23696\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Verify-NTP-Time-Synchronization.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23696\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Verify-NTP-Time-Synchronization.png\" alt=\"Verify NTP Time Synchronization\" width=\"753\" height=\"524\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Verify NTP Time Synchronization<\/p>\n<\/div>\n<p>By now, NTP server should work as expected.<\/p>\n<h3>Step 3: Join Windows 10 into Realm<\/h3>\n<p><strong>9.<\/strong>\u00a0As we saw in our previous tutorial,\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-active-directory-linux-command-line\/\" target=\"_blank\" rel=\"noopener\">Samba4 Active Directory can be managed from command line using samba-tool<\/a>\u00a0utility interface which can be accessed directly from server\u2019s VTY console or remotely connected through SSH.<\/p>\n<p>Other, more intuitively and flexible alternative, would be to manage our\u00a0<strong>Samba4 AD Domain Controller<\/strong>via\u00a0<strong>Microsoft Remote Server Administration Tools (RSAT)<\/strong>\u00a0from a Windows workstation integrated into the domain. These tools are available in almost all modern Windows systems.<\/p>\n<p>The process of joining\u00a0<strong>Windows 10<\/strong>\u00a0or older versions of\u00a0<strong>Microsoft OS into Samba4 AD DC<\/strong>\u00a0is very simple. First, make sure that your Windows 10 workstation has the correct\u00a0<strong>Samba4 DNS IP<\/strong>\u00a0address configured in order to query the proper realm resolver.<\/p>\n<p>Open\u00a0<strong>Control panel<\/strong>\u00a0-&gt;\u00a0<strong>Network and Internet<\/strong>\u00a0-&gt;\u00a0<strong>Network and Sharing Center<\/strong>\u00a0-&gt;\u00a0<strong>Ethernet card<\/strong>\u00a0-&gt;\u00a0<strong>Properties<\/strong>\u00a0-&gt;\u00a0<strong>IPv4<\/strong>\u00a0-&gt;\u00a0<strong>Properties<\/strong>\u00a0-&gt; Use the following DNS server addresses and manually place Samba4 AD IP Address to the network interface as illustrated in the below screenshots.<\/p>\n<div id=\"attachment_23698\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Join-Windows-to-Samba4-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23698\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Join-Windows-to-Samba4-AD.png\" sizes=\"auto, (max-width: 1028px) 100vw, 1028px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Join-Windows-to-Samba4-AD.png 1028w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Join-Windows-to-Samba4-AD-768x541.png 768w\" alt=\"join Windows to Samba4 AD\" width=\"1028\" height=\"724\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">join Windows to Samba4 AD<\/p>\n<\/div>\n<div id=\"attachment_23697\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Add-DNS-and-Samba4-AD-IP-Address.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23697\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Add-DNS-and-Samba4-AD-IP-Address.png\" alt=\"Add DNS and Samba4 AD IP Address\" width=\"478\" height=\"492\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Add DNS and Samba4 AD IP Address<\/p>\n<\/div>\n<p>Here,\u00a0<strong>192.168.1.254<\/strong>\u00a0is the IP Address of\u00a0<strong>Samba4 AD Domain Controller<\/strong>\u00a0responsible for DNS resolution. Replace the IP Address accordingly.<\/p>\n<p><strong>10.<\/strong>\u00a0Next, apply the network settings by hitting on\u00a0<strong>OK<\/strong>\u00a0button, open a\u00a0<strong>Command Prompt<\/strong>\u00a0and issue a\u00a0<strong>ping<\/strong>\u00a0against the generic domain name and Samba4 host FQDN in order to test if the realm is reachable through DNS resolution.<\/p>\n<pre>ping tecmint.lan\r\nping adc1.tecmint.lan\r\n<\/pre>\n<div id=\"attachment_23699\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Check-Samba4-AD-from-Windows.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23699\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Check-Samba4-AD-from-Windows.png\" alt=\"Check Network Connectivity Between Windows and Samba4 AD\" width=\"652\" height=\"588\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Check Network Connectivity Between Windows and Samba4 AD<\/p>\n<\/div>\n<p><strong>11.<\/strong>\u00a0If the resolver correctly responds to Windows client DNS queries, then, you need to assure that the time is accurately synchronized with the realm.<\/p>\n<p>Open\u00a0<strong>Control Panel<\/strong>\u00a0-&gt;\u00a0<strong>Clock<\/strong>,\u00a0<strong>Language<\/strong>\u00a0and\u00a0<strong>Region<\/strong>\u00a0-&gt;\u00a0<strong>Set Time and Date<\/strong>\u00a0-&gt;\u00a0<strong>Internet Time tab<\/strong>\u00a0-&gt;\u00a0<strong>Change Settings<\/strong>\u00a0and write your domain name on Synchronize with and Internet time server field.<\/p>\n<p>Hit on\u00a0<strong>Update Now<\/strong>\u00a0button to force time synchronization with the realm and hit\u00a0<strong>OK<\/strong>\u00a0to close the window.<\/p>\n<div id=\"attachment_23701\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Synchronize-Time-with-Internet-Server.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23701\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Synchronize-Time-with-Internet-Server.png\" sizes=\"auto, (max-width: 823px) 100vw, 823px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Synchronize-Time-with-Internet-Server.png 823w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Synchronize-Time-with-Internet-Server-768x527.png 768w\" alt=\"Synchronize Time with Internet Server\" width=\"823\" height=\"565\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Synchronize Time with Internet Server<\/p>\n<\/div>\n<p><strong>12.<\/strong>\u00a0Finally, join the domain by opening\u00a0<strong>System Properties<\/strong>\u00a0-&gt;\u00a0<strong>Change<\/strong>\u00a0-&gt;\u00a0<strong>Member of Domain<\/strong>, write your domain name, hit\u00a0<strong>OK<\/strong>, enter your domain administrative account credentials and hit\u00a0<strong>OK<\/strong>\u00a0again.<\/p>\n<p>A new pop-up window should open informing you\u2019re a member of the domain. Hit\u00a0<strong>OK<\/strong>\u00a0to close the pop-up window and\u00a0<strong>reboot<\/strong>\u00a0the machine in order to apply domain changes.<\/p>\n<p>The below screenshot will illustrate these steps.<\/p>\n<div id=\"attachment_23705\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Join-Windows-Domain-to-Samba4-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23705\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Join-Windows-Domain-to-Samba4-AD.png\" sizes=\"auto, (max-width: 1248px) 100vw, 1248px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Join-Windows-Domain-to-Samba4-AD.png 1248w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Join-Windows-Domain-to-Samba4-AD-768x451.png 768w\" alt=\"Join Windows Domain to Samba4 AD\" width=\"1248\" height=\"733\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Join Windows Domain to Samba4 AD<\/p>\n<\/div>\n<div id=\"attachment_23704\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Enter-Domain-Administration-Login.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23704\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Enter-Domain-Administration-Login.png\" alt=\"Enter Domain Administration Login\" width=\"606\" height=\"735\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Enter Domain Administration Login<\/p>\n<\/div>\n<div id=\"attachment_23703\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Domain-Joined-to-Samba4-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23703\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Domain-Joined-to-Samba4-AD.png\" alt=\"Domain Joined to Samba4 AD Confirmation\" width=\"319\" height=\"175\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Domain Joined to Samba4 AD Confirmation<\/p>\n<\/div>\n<div id=\"attachment_23702\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Restart-Windows-Server-for-Changes.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23702\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Restart-Windows-Server-for-Changes.png\" alt=\"Restart Windows Server for Changes\" width=\"356\" height=\"176\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Restart Windows Server for Changes<\/p>\n<\/div>\n<p><strong>13.<\/strong>\u00a0After restart, hit on\u00a0<strong>Other<\/strong>\u00a0user and logon to Windows with a Samba4 domain account with administrative privileges and you should be ready to move to the next step.<\/p>\n<div id=\"attachment_23706\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Login-to-Windows-Using-Samba4-AD-Account.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23706\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Login-to-Windows-Using-Samba4-AD-Account.png\" alt=\"Login to Windows Using Samba4 AD Account\" width=\"764\" height=\"419\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Login to Windows Using Samba4 AD Account<\/p>\n<\/div>\n<h4>Step 4: Administer Samba4 AD DC with RSAT<\/h4>\n<p><strong>14.<\/strong><strong>Microsoft Remote Server Administration Tools (RSAT)<\/strong>, which will be further used to administer\u00a0<strong>Samba4 Active Directory<\/strong>, can be downloaded from the following links, depending on your Windows version:<\/p>\n<ol>\n<li><strong>Windows 10<\/strong>:\u00a0<a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=45520\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=45520<\/a><\/li>\n<li><strong>Windows 8.1<\/strong>:\u00a0<a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=39296\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=39296<\/a><\/li>\n<li><strong>Windows 8<\/strong>:\u00a0<a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=28972\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=28972<\/a><\/li>\n<li><strong>Windows 7<\/strong>:\u00a0<a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=7887\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=7887<\/a><\/li>\n<\/ol>\n<p>Once the update standalone installer package for\u00a0<strong>Windows 10<\/strong>\u00a0has been downloaded on your system, run the installer, wait for the installation to finish and restart the machine to apply all updates.<\/p>\n<p>After\u00a0<strong>reboot<\/strong>, open\u00a0<strong>Control Panel<\/strong>\u00a0-&gt;\u00a0<strong>Programs<\/strong>\u00a0(<strong>Uninstall a Program<\/strong>) -&gt;\u00a0<strong>Turn Windows features on or off<\/strong>\u00a0and check all\u00a0<strong>Remote Server Administration Tools<\/strong>.<\/p>\n<p>Click\u00a0<strong>OK<\/strong>\u00a0to start the installation and after the installation process finishes, restart the system.<\/p>\n<div id=\"attachment_23707\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Administer-Samba4-AD-from-Windows.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23707\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Administer-Samba4-AD-from-Windows.png\" sizes=\"auto, (max-width: 920px) 100vw, 920px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Administer-Samba4-AD-from-Windows.png 920w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Administer-Samba4-AD-from-Windows-768x524.png 768w\" alt=\"Administer Samba4 AD from Windows\" width=\"920\" height=\"628\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Administer Samba4 AD from Windows<\/p>\n<\/div>\n<p><strong>15.<\/strong>\u00a0To access\u00a0<strong>RSAT<\/strong>\u00a0tools go to\u00a0<strong>Control Panel<\/strong>\u00a0-&gt;\u00a0<strong>System and Security<\/strong>\u00a0-&gt;\u00a0<strong>Administrative Tools<\/strong>.<\/p>\n<p>The tools can also be found in the\u00a0<strong>Administrative<\/strong>\u00a0tools menu from start menu. Alternatively, you can open\u00a0<strong>Windows MMC<\/strong>\u00a0and add Snap-ins using the\u00a0<strong>File<\/strong>\u00a0-&gt;\u00a0<strong>Add\/Remove<\/strong>\u00a0Snap-in menu.<\/p>\n<div id=\"attachment_23708\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Access-Remote-Server-Administration-Tools.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23708\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Access-Remote-Server-Administration-Tools.png\" sizes=\"auto, (max-width: 856px) 100vw, 856px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Access-Remote-Server-Administration-Tools.png 856w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Access-Remote-Server-Administration-Tools-768x554.png 768w\" alt=\"Access Remote Server Administration Tools\" width=\"856\" height=\"617\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Access Remote Server Administration Tools<\/p>\n<\/div>\n<p>The most used tools, such as\u00a0<strong>AD UC<\/strong>,\u00a0<strong>DNS<\/strong>\u00a0and\u00a0<strong>Group Policy Management<\/strong>\u00a0can be launched directly from Desktop by creating shortcuts using Send to feature from menu.<\/p>\n<p><strong>16.<\/strong>\u00a0You can verify\u00a0<strong>RSAT<\/strong>\u00a0functionality by opening\u00a0<strong>AD UC<\/strong>\u00a0and list domain Computers (newly joined windows machine should appear in the list), create a new\u00a0<strong>Organizational Unit<\/strong>\u00a0or a new user or group.<\/p>\n<p>Verify if the users or groups had been properly created by issuing\u00a0<strong>wbinfo<\/strong>\u00a0command from Samba4 server side.<\/p>\n<div id=\"attachment_23711\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Active-Directory-Users-and-Computers.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23711\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Active-Directory-Users-and-Computers.png\" sizes=\"auto, (max-width: 911px) 100vw, 911px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Active-Directory-Users-and-Computers.png 911w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Active-Directory-Users-and-Computers-768x429.png 768w\" alt=\"Active Directory Users and Computers\" width=\"911\" height=\"509\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Active Directory Users and Computers<\/p>\n<\/div>\n<div id=\"attachment_23710\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Create-Organizational-Unit-and-Users.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23710\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Create-Organizational-Unit-and-Users.png\" sizes=\"auto, (max-width: 911px) 100vw, 911px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Create-Organizational-Unit-and-Users.png 911w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Create-Organizational-Unit-and-Users-768x360.png 768w\" alt=\"Create Organizational Units and New Users\" width=\"911\" height=\"427\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Create Organizational Units and New Users<\/p>\n<\/div>\n<div id=\"attachment_23709\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Confirm-Samba4-AD-Users.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23709\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Confirm-Samba4-AD-Users.png\" alt=\"Confirm Samba4 AD Users\" width=\"638\" height=\"180\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Confirm Samba4 AD Users<\/p>\n<\/div>\n<p>That\u2019s it! On the next part of this topic we will cover other important aspects of a\u00a0<strong>Samba4 Active Directory<\/strong>\u00a0which can be administered via\u00a0<strong>RSAT<\/strong>, such as, how to manage DNS server, add DNS records and create a reverse DNS lookup zone, how to manage and apply domain policy and how to create an interactive logon banner for your domain users.<\/p>\n<\/div>\n<h1 class=\"post-title\">Manage Samba4 AD Domain Controller DNS and Group Policy from Windows \u2013 Part 4<\/h1>\n<p class=\"post-byline\">by\u00a0<a title=\"Posts by Matei Cezar\" href=\"https:\/\/www.tecmint.com\/author\/cezarmatei\/\" rel=\"author\">Matei Cezar<\/a>\u00a0| Published: December 7, 2016 | Last Updated: December 7, 2016<\/p>\n<div class=\"clear\"><\/div>\n<div class=\"add-box\"><ins class=\"adsbygoogle\" data-ad-client=\"ca-pub-2601749019656699\" data-ad-slot=\"1986283779\" data-adsbygoogle-status=\"done\"><ins id=\"aswift_1_expand\"><ins id=\"aswift_1_anchor\"><iframe id=\"aswift_1\" name=\"aswift_1\" width=\"468\" height=\"15\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" allowfullscreen=\"allowfullscreen\" data-mce-fragment=\"1\"><\/iframe><\/ins><\/ins><\/ins><\/div>\n<div class=\"clear\"><\/div>\n<div id=\"exam_announcement\"><i class=\"fa fa-book\"><\/i>\u00a0<b>Download Your Free eBooks NOW<\/b>\u00a0&#8211;\u00a0<a href=\"https:\/\/www.tecmint.com\/10-useful-free-linux-ebooks-for-newbies-and-administrators\/\" target=\"_blank\" rel=\"noopener\">10 Free Linux eBooks for Administrators<\/a>\u00a0|\u00a0<a href=\"https:\/\/www.tecmint.com\/free-linux-shell-scripting-books\/\" target=\"_blank\" rel=\"noopener\">4 Free Shell Scripting eBooks<\/a><\/div>\n<div class=\"clear\"><\/div>\n<div class=\"clear\"><\/div>\n<div class=\"entry share\">\n<div class=\"entry-inner\">\n<p>Continuing the previous tutorial on\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-ad-from-windows-via-rsat\/\" target=\"_blank\" rel=\"noopener\">how to administer Samba4 from Windows 10 via RSAT<\/a>, in this part we\u2019ll see how to remotely manage our Samba AD Domain controller DNS server from Microsoft DNS Manager, how to create DNS records, how to create a Reverse Lookup Zone and how to create a domain policy via Group Policy Management tool.<\/p>\n<h4>Requirements<\/h4>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/install-samba4-active-directory-ubuntu\/\" target=\"_blank\" rel=\"noopener\">Create an AD Infrastructure with Samba4 on Ubuntu 16.04 \u2013 Part 1<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/manage-samba4-active-directory-linux-command-line\/\" target=\"_blank\" rel=\"noopener\">Manage Samba4 AD Infrastructure from Linux Command Line \u2013 Part 2<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/manage-samba4-ad-from-windows-via-rsat\/\" target=\"_blank\" rel=\"noopener\">Manage Samba4 Active Directory Infrastructure from Windows10 via RSAT \u2013 Part 3<\/a><\/li>\n<\/ol>\n<h3>Step 1: Manage Samba DNS Server<\/h3>\n<p><strong>Samba4 AD DC<\/strong>\u00a0uses an internal DNS resolver module which is created during the initial domain provision (if\u00a0<strong>BIND9 DLZ<\/strong>\u00a0module is not specifically used).<\/p>\n<p><strong>Samba4<\/strong>\u00a0internal\u00a0<strong>DNS<\/strong>\u00a0module supports the basic features needed for an\u00a0<strong>AD Domain Controller<\/strong>. The domain DNS server can be managed in two ways, directly from command line through samba-tool interface or remotely from a Microsoft workstation which is part of the domain via\u00a0<strong>RSAT DNS Manager<\/strong>.<\/p>\n<p>Here, we\u2019ll cover the second method because it\u2019s more intuitive and not so prone to errors.<\/p>\n<p><center><ins class=\"adsbygoogle\" data-ad-client=\"ca-pub-2601749019656699\" data-ad-slot=\"5590002574\" data-ad-format=\"auto\" data-adsbygoogle-status=\"done\"><ins id=\"aswift_3_expand\"><ins id=\"aswift_3_anchor\"><iframe id=\"aswift_3\" name=\"aswift_3\" width=\"710\" height=\"60\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" allowfullscreen=\"allowfullscreen\" data-mce-fragment=\"1\"><\/iframe><\/ins><\/ins><\/ins><\/center><strong>1.<\/strong>\u00a0To administer the DNS service for your domain controller via\u00a0<strong>RSAT<\/strong>, go to your Windows machine, open\u00a0<strong>Control Panel<\/strong>\u00a0<strong>-&gt;<\/strong>\u00a0<strong>System and Security<\/strong>\u00a0-&gt;\u00a0<strong>Administrative Tools<\/strong>\u00a0and run\u00a0<strong>DNS Manager<\/strong>\u00a0utility.<\/p>\n<p>Once the tool opens, it will ask you on what DNS running server you want to connect. Choose The following computer, type your\u00a0<strong>domain name<\/strong>\u00a0in the field (or\u00a0<strong>IP Address<\/strong>\u00a0or\u00a0<strong>FQDN<\/strong>\u00a0can be used as well), check the box that says \u2018<strong>Connect to the specified computer now<\/strong>\u2019 and hit\u00a0<strong>OK<\/strong>\u00a0to open your\u00a0<strong>Samba DNS<\/strong>service.<\/p>\n<div id=\"attachment_23736\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Connect-Samba4-DNS-on-Windows.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23736\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Connect-Samba4-DNS-on-Windows.png\" alt=\"Connect Samba4 DNS on Windows\" width=\"516\" height=\"299\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Connect Samba4 DNS on Windows<\/p>\n<\/div>\n<p><strong>2.<\/strong>\u00a0In order to add a DNS record (as an example we will add an\u00a0<code>A<\/code>\u00a0record that will point to our LAN gateway), navigate to domain\u00a0<strong>Forward Lookup Zone<\/strong>, right click on the right plane and choose\u00a0<strong>New Host<\/strong>\u00a0(<code>A<\/code>\u00a0or\u00a0<code>AAA<\/code>).<\/p>\n<div id=\"attachment_23737\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Add-DNS-A-Record.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23737\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Add-DNS-A-Record.png\" sizes=\"auto, (max-width: 812px) 100vw, 812px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Add-DNS-A-Record.png 812w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Add-DNS-A-Record-768x545.png 768w\" alt=\"Add DNS A Record on Windows\" width=\"812\" height=\"576\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Add DNS A Record on Windows<\/p>\n<\/div>\n<p><strong>3.<\/strong>\u00a0On the New host opened window, type the\u00a0<strong>name<\/strong>\u00a0and the\u00a0<strong>IP Address<\/strong>\u00a0of your DNS resource. The\u00a0<strong>FQDN<\/strong>\u00a0will be automatically written for you by DNS utility. When finished, hit the\u00a0<strong>Add Host<\/strong>\u00a0button and a pop-up window will inform you that your\u00a0<strong>DNS A<\/strong>\u00a0record has been successfully created.<\/p>\n<p>Make sure you add\u00a0<strong>DNS A<\/strong>\u00a0records only for those resources in your network\u00a0<a href=\"https:\/\/www.tecmint.com\/set-add-static-ip-address-in-linux\/\" target=\"_blank\" rel=\"noopener\">configured with static IP Addresses<\/a>. Don\u2019t add\u00a0<strong>DNS A<\/strong>\u00a0records for hosts which are configured to acquire network configurations from a\u00a0<strong>DHCP<\/strong>\u00a0server or their\u00a0<strong>IP Addresses<\/strong>\u00a0change often.<\/p>\n<div id=\"attachment_23738\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Configure-Samba-Host-on-Windows.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23738\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Configure-Samba-Host-on-Windows.png\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Configure-Samba-Host-on-Windows.png 975w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Configure-Samba-Host-on-Windows-768x515.png 768w\" alt=\"Configure Samba Host on Windows\" width=\"975\" height=\"654\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Configure Samba Host on Windows<\/p>\n<\/div>\n<p>To update a\u00a0<strong>DNS<\/strong>\u00a0record just double click on it and write your modifications. To delete the record right click on the\u00a0<strong>record<\/strong>\u00a0and choose\u00a0<strong>delete<\/strong>\u00a0from the menu.<\/p>\n<p>In the same way you can add other types of\u00a0<strong>DNS<\/strong>\u00a0records for your domain, such as\u00a0<strong>CNAME<\/strong>\u00a0(also known as\u00a0<strong>DNS alias<\/strong>\u00a0record)\u00a0<strong>MX<\/strong>\u00a0records (very useful for mail servers) or other type of records (<strong>SPF<\/strong>,\u00a0<strong>TXT<\/strong>,\u00a0<strong>SRV<\/strong>\u00a0etc).<\/p>\n<h3>Step 2: Create a Reverse Lookup Zone<\/h3>\n<p>By default,\u00a0<strong>Samba4 Ad DC<\/strong>\u00a0doesn\u2019t automatically add a reverse lookup zone and PTR records for your domain because these types of records are not crucial for a domain controller to function correctly.<\/p>\n<p>Instead, a DNS reverse zone and its PTR records are crucial for the functionality of some important network services, such as an e-mail service because these type of records can be used to verify the identity of clients requesting a service.<\/p>\n<p>Practically, PTR records are just the opposite of standard DNS records. The clients know the IP address of a resource and queries the DNS server to find out their registered DNS name.<\/p>\n<p><strong>4.<\/strong>\u00a0In order to a create a reverse lookup zone for\u00a0<strong>Samba AD DC<\/strong>, open\u00a0<strong>DNS Manager<\/strong>, right click on\u00a0<strong>Reverse Lookup Zone<\/strong>\u00a0from the left plane and choose\u00a0<strong>New Zone<\/strong>\u00a0from the menu.<\/p>\n<div id=\"attachment_23739\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Create-Reverse-Lookup-DNS-Zone.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23739\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Create-Reverse-Lookup-DNS-Zone.png\" sizes=\"auto, (max-width: 907px) 100vw, 907px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Create-Reverse-Lookup-DNS-Zone.png 907w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Create-Reverse-Lookup-DNS-Zone-768x529.png 768w\" alt=\"Create Reverse Lookup DNS Zone\" width=\"907\" height=\"625\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Create Reverse Lookup DNS Zone<\/p>\n<\/div>\n<p><strong>5.<\/strong>\u00a0Next, hit\u00a0<strong>Next<\/strong>\u00a0button and choose\u00a0<strong>Primary<\/strong>\u00a0zone from\u00a0<strong>Zone Type Wizard<\/strong>.<\/p>\n<div id=\"attachment_23740\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Select-DNS-Zone-Type.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23740\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Select-DNS-Zone-Type.png\" alt=\"Select DNS Zone Type\" width=\"553\" height=\"404\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Select DNS Zone Type<\/p>\n<\/div>\n<p><strong>6.<\/strong>\u00a0Next, choose To all\u00a0<strong>DNS<\/strong>\u00a0servers running on domain controllers in this domain from the\u00a0<strong>AD Zone Replication Scope<\/strong>, chose\u00a0<strong>IPv4 Reverse Lookup Zone<\/strong>\u00a0and hit\u00a0<strong>Next<\/strong>\u00a0to continue.<\/p>\n<div id=\"attachment_23741\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Select-DNS-for-Samba-Domain-Controller.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23741\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Select-DNS-for-Samba-Domain-Controller.png\" alt=\"Select DNS for Samba Domain Controller\" width=\"641\" height=\"472\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Select DNS for Samba Domain Controller<\/p>\n<\/div>\n<div id=\"attachment_23742\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Add-Reverse-Lookup-Zone-Name.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23742\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Add-Reverse-Lookup-Zone-Name.png\" alt=\"Add Reverse Lookup Zone Name\" width=\"517\" height=\"402\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Add Reverse Lookup Zone Name<\/p>\n<\/div>\n<p><strong>7.<\/strong>\u00a0Next, type the IP network address for your\u00a0<strong>LAN<\/strong>\u00a0in\u00a0<strong>Network ID<\/strong>\u00a0filed and hit\u00a0<strong>Next<\/strong>\u00a0to continue.<\/p>\n<p>All\u00a0<strong>PTR<\/strong>\u00a0records added in this zone for your resources will point back only to\u00a0<strong>192.168.1.0\/24<\/strong>\u00a0network portion. If you want to create a PTR record for a server that does not reside in this network segment (for example mail server which is located in\u00a0<strong>10.0.0.0\/24<\/strong>\u00a0network), then you\u2019ll need to create a new reverse lookup zone for that network segment as well.<\/p>\n<div id=\"attachment_23743\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Add-IP-Address-of-Reverse-DNS-Zone.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23743\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Add-IP-Address-of-Reverse-DNS-Zone.png\" alt=\"Add IP Address of Reverse Lookup DNS Zone\" width=\"509\" height=\"378\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Add IP Address of Reverse Lookup DNS Zone<\/p>\n<\/div>\n<p><strong>8.<\/strong>\u00a0On the next screen choose to\u00a0<strong>Allow<\/strong>\u00a0only secure dynamic updates, hit next to continue and, finally hit on\u00a0<strong>finish<\/strong>\u00a0to complete zone creation.<\/p>\n<div id=\"attachment_23744\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Enable-Secure-Dynamic-Updates.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23744\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Enable-Secure-Dynamic-Updates.png\" alt=\"Enable Secure Dynamic Updates\" width=\"507\" height=\"382\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Enable Secure Dynamic Updates<\/p>\n<\/div>\n<div id=\"attachment_23745\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/New-DNS-Zone-Summary.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23745\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/New-DNS-Zone-Summary.png\" alt=\"New DNS Zone Summary\" width=\"525\" height=\"411\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">New DNS Zone Summary<\/p>\n<\/div>\n<p><strong>9.<\/strong>\u00a0At this point you have a valid DNS reverse lookup zone configured for your domain. In order to add a\u00a0<strong>PTR<\/strong>\u00a0record in this zone, right click on the right\u00a0<strong>plane<\/strong>\u00a0and choose to create a\u00a0<strong>PTR<\/strong>\u00a0record for a network resource.<\/p>\n<p>In this case we\u2019ve created a pointer for our gateway. In order to test if the record was properly added and works as expected from client\u2019s point of view, open a\u00a0<strong>Command Prompt<\/strong>\u00a0and issue a\u00a0<strong>nslookup<\/strong>query against the name of the resource and another query for its IP Address.<\/p>\n<p>Both queries should return the correct answer for your DNS resource.<\/p>\n<pre>nslookup gate.tecmint.lan\r\nnslookup 192.168.1.1\r\nping gate\r\n<\/pre>\n<div id=\"attachment_23746\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Add-DNS-PTR-Record-and-Query.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23746\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Add-DNS-PTR-Record-and-Query.png\" sizes=\"auto, (max-width: 1146px) 100vw, 1146px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Add-DNS-PTR-Record-and-Query.png 1146w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Add-DNS-PTR-Record-and-Query-768x359.png 768w\" alt=\"Add DNS PTR Record and Query PTR\" width=\"1146\" height=\"535\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Add DNS PTR Record and Query PTR<\/p>\n<\/div>\n<h3>Step 3: Domain Group Policy Management<\/h3>\n<p><strong>10.<\/strong>\u00a0An important aspect of a domain controller is its ability to control system resources and security from a single central point. This type of task can be easily achieved in a domain controller with the help of\u00a0<strong>Domain Group Policy<\/strong>.<\/p>\n<p>Unfortunately, the only way to edit or manage group policy in a samba domain controller is through\u00a0<strong>RSAT GPM<\/strong>\u00a0console provided by Microsoft.<\/p>\n<p>In the below example we\u2019ll see how simple can be to manipulate group policy for our samba domain in order to create an interactive logon banner for our domain users.<\/p>\n<p>In order to access group policy console, go to\u00a0<strong>Control Panel<\/strong>\u00a0<strong>-&gt;<\/strong>\u00a0<strong>System and Security<\/strong>\u00a0<strong>-&gt;<\/strong>\u00a0<strong>Administrative Tools<\/strong>\u00a0and open\u00a0<strong>Group Policy Management<\/strong>\u00a0console.<\/p>\n<p>Expand the fields for your domain and right click on\u00a0<strong>Default Domain Policy<\/strong>. Choose\u00a0<strong>Edit<\/strong>\u00a0from the menu and a new windows should appear.<\/p>\n<div id=\"attachment_23747\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Manage-Samba-Domain-Group-Policy.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23747\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Manage-Samba-Domain-Group-Policy.png\" sizes=\"auto, (max-width: 885px) 100vw, 885px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Manage-Samba-Domain-Group-Policy.png 885w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Manage-Samba-Domain-Group-Policy-768x480.png 768w\" alt=\"Manage Samba Domain Group Policy\" width=\"885\" height=\"553\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Manage Samba Domain Group Policy<\/p>\n<\/div>\n<p><strong>11.<\/strong>\u00a0On\u00a0<strong>Group Policy Management Editor<\/strong>\u00a0window go to\u00a0<strong>Computer Configuration<\/strong>\u00a0<strong>-&gt;<\/strong>\u00a0<strong>Policies<\/strong>\u00a0<strong>-&gt;<\/strong><strong>Windows Settings<\/strong>\u00a0<strong>-&gt;<\/strong>\u00a0<strong>Security settings<\/strong>\u00a0<strong>-&gt;<\/strong>\u00a0<strong>Local Policies<\/strong>\u00a0-&gt;\u00a0<strong>Security Options<\/strong>\u00a0and a new options list should appear in the right plane.<\/p>\n<p>In the right plane search and edit with your custom settings following two entries presented on the below screenshot.<\/p>\n<div id=\"attachment_23748\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Configure-Samba-Domain-Group-Policy.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23748\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Configure-Samba-Domain-Group-Policy.png\" sizes=\"auto, (max-width: 1192px) 100vw, 1192px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Configure-Samba-Domain-Group-Policy.png 1192w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Configure-Samba-Domain-Group-Policy-768x438.png 768w\" alt=\"Configure Samba Domain Group Policy\" width=\"1192\" height=\"680\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Configure Samba Domain Group Policy<\/p>\n<\/div>\n<p><strong>12.<\/strong>\u00a0After finishing editing the two entries, close all windows, open an elevated Command prompt and force group policy to apply on your machine by issuing the below command:<\/p>\n<pre>gpupdate \/force\r\n<\/pre>\n<div id=\"attachment_23749\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Update-Samba-Domain-Group-Policy.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23749\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Update-Samba-Domain-Group-Policy.png\" alt=\"Update Samba Domain Group Policy\" width=\"727\" height=\"381\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Update Samba Domain Group Policy<\/p>\n<\/div>\n<p><strong>13.<\/strong>\u00a0Finally, reboot your computer and you\u2019ll see the logon banner in action when you\u2019ll try to perform logon.<\/p>\n<div id=\"attachment_23750\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Samba4-Domain-Controller-User-Login.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23750\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Samba4-Domain-Controller-User-Login.png\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Samba4-Domain-Controller-User-Login.png 774w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/Samba4-Domain-Controller-User-Login-768x356.png 768w\" alt=\"Samba4 AD Domain Controller Logon Banner\" width=\"774\" height=\"359\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Samba4 AD Domain Controller Logon Banner<\/p>\n<\/div>\n<p>That\u2019s all!\u00a0<strong>Group Policy<\/strong>\u00a0is a very complex and sensitive subject and should be treated with maximum care by system admins. Also, be aware that group policy settings won\u2019t apply in any way to Linux systems integrated into the realm.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step 1: Initial Configuration for Samba4 1.\u00a0Before proceeding your\u00a0Samba4 AD DC\u00a0installation first let\u2019s run a few pre-required steps. First make sure the system is up to date with the last security features, kernels and packages by issuing the below command: $ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get dist-upgrade 2.\u00a0Next, open machine\u00a0\/etc\/fstab\u00a0file [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":621,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-888","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/888","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=888"}],"version-history":[{"count":1,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/888\/revisions"}],"predecessor-version":[{"id":889,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/888\/revisions\/889"}],"up":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/621"}],"wp:attachment":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}