{"id":13405,"date":"2019-04-02T01:25:41","date_gmt":"2019-04-02T01:25:41","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13405"},"modified":"2019-04-02T01:27:29","modified_gmt":"2019-04-02T01:27:29","slug":"active-directory-ad","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/02\/active-directory-ad\/","title":{"rendered":"ACTIVE DIRECTORY (AD) Infrastructure with SAMBA4 on Ubuntu"},"content":{"rendered":"<h1 class=\"post-title\">Create an Active Directory Infrastructure with Samba4 on Ubuntu \u2013 Part 1<\/h1>\n<p><strong>Samba<\/strong>\u00a0is a free Open Source software which provides a standard interoperability between\u00a0<strong>Windows OS<\/strong>\u00a0and\u00a0<strong>Linux\/Unix<\/strong>\u00a0Operating Systems.<\/p>\n<p>Samba can operate as a standalone file and print server for Windows and Linux clients through the\u00a0<strong>SMB\/CIFS<\/strong>protocol suite or can act as an\u00a0<strong>Active Directory Domain Controller<\/strong>\u00a0or joined into a\u00a0<strong>Realm<\/strong>\u00a0as a\u00a0<strong>Domain Member<\/strong>. The highest\u00a0<strong>AD DC<\/strong>\u00a0domain and forest level that currently\u00a0<strong>Samba4<\/strong>\u00a0can emulate is\u00a0<strong>Windows 2008 R2<\/strong>.<\/p>\n<p>The series will be titled\u00a0<strong>Setting Up Samba4 Active Directory Domain Controller<\/strong>, which covers following topics for\u00a0<strong>Ubuntu<\/strong>,\u00a0<strong>CentOS<\/strong>, and\u00a0<strong>Windows<\/strong>:<\/p>\n<div id=\"exam_announcement\"><b>Part 1<\/b>:\u00a0<b>Install Active Directory Infrastructure with SAMBA4 on Ubuntu<\/b><\/div>\n<div id=\"exam_announcement\"><b>Part 2<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-active-directory-linux-command-line\/\" target=\"_blank\" rel=\"noopener noreferrer\">Manage Samba4 AD Infrastructure from Linux Command Line<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 3<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-ad-from-windows-via-rsat\/\">Manage Samba4 Active Directory Infrastructure from Windows10 via RSAT<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 4<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-dns-group-policy-from-windows\/\">Manage Samba4 AD Domain Controller DNS and Group Policy from Windows<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 5<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/join-additional-ubuntu-dc-to-samba4-ad-dc-failover-replication\/\" target=\"_blank\" rel=\"noopener noreferrer\">Join an Additional Ubuntu DC to Samba4 AD DC<\/a><\/div>\n<div id=\"exam_announcement\"><b>Pare 6<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/samba4-ad-dc-sysvol-replication\/\" target=\"_blank\" rel=\"noopener noreferrer\">Setup SysVol Replication Across Two Samba4 AD DC with Rsync<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 7<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/create-shared-directory-on-samba-ad-dc-and-map-to-windows-linux\/\" target=\"_blank\" rel=\"noopener noreferrer\">Create a Shared Directory on Samba AD DC and Map to Windows\/Linux Clients<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 8<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/join-ubuntu-to-active-directory-domain-member-samba-winbind\/\" target=\"_blank\" rel=\"noopener noreferrer\">Integrate Ubuntu 16.04 to AD as a Domain Member with Samba and Winbind<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 9<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/join-centos-7-to-samba4-active-directory\/\" target=\"_blank\" rel=\"noopener noreferrer\">Integrate CentOS 7 Desktop to Samba4 AD as a Domain Member<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 10<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/install-iredmail-on-centos-7-for-samba4-ad-integration\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Install iRedMail on CentOS 7 for Samba4 AD Integration<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 11<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/integrate-iredmail-to-samba4-ad-dc-on-centos-7\/\" target=\"_blank\" rel=\"noopener noreferrer\">Integrate iRedMail Services to Samba4 AD DC<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 12<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/integrate-iredmail-roundcube-with-samba4-ad-dc\/\" target=\"_blank\" rel=\"noopener\">How to Integrate iRedMail Roundcube with Samba4 AD DC<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 13<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/configure-thunderbird-with-iredmail-for-samba4-ad-ldap\/\" target=\"_blank\" rel=\"noopener\">How to Configure Thunderbird with iRedMail for Samba4 AD<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 14<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/integrate-ubuntu-to-samba4-ad-dc-with-sssd-and-realm\/\" target=\"_blank\" rel=\"noopener\">Integrate Ubuntu 16.04 to Samba4 AD DC with SSSD and Realm<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 15<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/integrate-centos-7-to-samba4-active-directory\/\" target=\"_blank\" rel=\"noopener\">Integrate CentOS 7 from Command Line to Samba AD DC as a Domain Member<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 16<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/integrate-vmware-esxi-to-samba4-domain\/\" target=\"_blank\" rel=\"noopener\">Integrate VMware ESXI Host to Samba4 AD Domain Controller<\/a><\/div>\n<p>This tutorial will start by explaining all the steps you need to take care off in order to install and configure\u00a0<strong>Samba4<\/strong>\u00a0as a\u00a0<strong>Domain Controller<\/strong>\u00a0on\u00a0<strong>Ubuntu 16.04<\/strong>\u00a0and\u00a0<strong>Ubuntu 14.04<\/strong>.<\/p>\n<p>This configuration will provide a central management point for users, machines, volume shares, permissions and other resources in a mixed-up Windows \u2013 Linux infrastructure.<\/p>\n<h4>Requirements:<\/h4>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/installation-of-ubuntu-16-04-server-edition\/\" target=\"_blank\" rel=\"noopener noreferrer\">Ubuntu 16.04 Server Installation<\/a>.<\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/ubuntu-14-04-server-installation-guide-and-lamp-setup\/\" target=\"_blank\" rel=\"noopener noreferrer\">Ubuntu 14.04 Server Installation<\/a>.<\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/set-add-static-ip-address-in-linux\/\" target=\"_blank\" rel=\"noopener noreferrer\">A static IP Address configured<\/a>\u00a0for your\u00a0<strong>AD DC<\/strong>\u00a0server.<\/li>\n<\/ol>\n<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\">\n<p><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\" aria-describedby=\"caption-attachment-23462\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23462\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23463\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23463\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23464\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23464\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23465\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23465\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23466\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23466\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23467\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23467\" 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\/krb5.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\">\n<p><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\" aria-describedby=\"caption-attachment-23468\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23468\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23469\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23469\" 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>\u00a0to run properly.<\/p>\n<pre>$ sudo netstat \u2013tulpn| egrep \u2018smbd|samba\u2019\r\n<\/pre>\n<div id=\"attachment_23470\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23470\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23470\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23471\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23471\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23472\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23472\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23473\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23473\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23474\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23474\" 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<h1 class=\"post-title\">How to Manage Samba4 AD Infrastructure from Linux Command Line \u2013 Part 2<\/h1>\n<p>This tutorial will cover\u00a0<a href=\"https:\/\/www.tecmint.com\/60-commands-of-linux-a-guide-from-newbies-to-system-administrator\/\" target=\"_blank\" rel=\"noopener\">some basic daily commands<\/a>\u00a0you need to use in order to manage\u00a0<strong>Samba4 AD Domain Controller<\/strong>\u00a0infrastructure, such as adding, removing, disabling or listing users and groups.<\/p>\n<p>We\u2019ll also take a look on how to manage domain security policy and how to bind AD users to local PAM authentication in order for AD users to be able to perform local logins on Linux Domain Controller.<\/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-ad-from-windows-via-rsat\/\" target=\"_blank\" rel=\"noopener\">Manage Samba4 Active Directory Infrastructure from Windows10 via RSAT \u2013 Part 3<\/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: 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>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\">\n<p><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\" aria-describedby=\"caption-attachment-23483\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23483\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23484\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23484\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23485\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23485\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23487\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23487\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23488\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23488\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23489\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23489\" 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>\u00a0environment.<\/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\">\n<p><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\" aria-describedby=\"caption-attachment-23490\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23490\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23491\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23491\" 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>\u00a0accounts 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\">\n<p><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\" aria-describedby=\"caption-attachment-23492\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23492\" class=\"wp-caption-text\">Configure PAM for Samba4 AD<\/p>\n<\/div>\n<div id=\"attachment_23493\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23493\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23493\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23494\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23494\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23495\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23495\" 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>package 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\">\n<p><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\" aria-describedby=\"caption-attachment-23497\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23497\" class=\"wp-caption-text\">Check Samba4 AD Information<\/p>\n<\/div>\n<div id=\"attachment_23496\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23496\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23496\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23498\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23498\" 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>\u00a0parameter 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\">\n<p><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\" aria-describedby=\"caption-attachment-23500\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23500\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23501\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23501\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23502\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23502\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23503\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23503\" 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>.<\/p>\n<h1 class=\"post-title\">Manage Samba4 Active Directory Infrastructure from Windows10 via RSAT \u2013 Part 3<\/h1>\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\">\n<p><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\" aria-describedby=\"caption-attachment-23685\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23685\" 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\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\">\n<p><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\" aria-describedby=\"caption-attachment-23686\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23686\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23688\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23688\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23689\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23689\" 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>\u00a0combined 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\">\n<p><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\" aria-describedby=\"caption-attachment-23690\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23690\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23691\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23691\" 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>\r\n<\/pre>\n<div id=\"attachment_23693\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23693\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23693\" 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>\r\n<\/pre>\n<div id=\"attachment_23694\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23694\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23694\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23695\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23695\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23696\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23696\" 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>\u00a0via\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\">\n<p><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\" aria-describedby=\"caption-attachment-23698\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23698\" class=\"wp-caption-text\">join Windows to Samba4 AD<\/p>\n<\/div>\n<div id=\"attachment_23697\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23697\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23697\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23699\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23699\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23701\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23701\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23705\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23705\" class=\"wp-caption-text\">Join Windows Domain to Samba4 AD<\/p>\n<\/div>\n<div id=\"attachment_23704\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23704\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23704\" class=\"wp-caption-text\">Enter Domain Administration Login<\/p>\n<\/div>\n<div id=\"attachment_23703\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23703\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23703\" class=\"wp-caption-text\">Domain Joined to Samba4 AD Confirmation<\/p>\n<\/div>\n<div id=\"attachment_23702\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23702\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23702\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23706\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23706\" 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>\u00a0<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\">\n<p><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\" aria-describedby=\"caption-attachment-23707\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23707\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23708\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23708\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23711\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23711\" class=\"wp-caption-text\">Active Directory Users and Computers<\/p>\n<\/div>\n<div id=\"attachment_23710\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23710\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23710\" class=\"wp-caption-text\">Create Organizational Units and New Users<\/p>\n<\/div>\n<div id=\"attachment_23709\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23709\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23709\" 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>which 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<h1 class=\"post-title\">Manage Samba4 AD Domain Controller DNS and Group Policy from Windows \u2013 Part 4<\/h1>\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><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>\u00a0service.<\/p>\n<div id=\"attachment_23736\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23736\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23736\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23737\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23737\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23738\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23738\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23739\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23739\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23740\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23740\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23741\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23741\" class=\"wp-caption-text\">Select DNS for Samba Domain Controller<\/p>\n<\/div>\n<div id=\"attachment_23742\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23742\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23742\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23743\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23743\" 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>to complete zone creation.<\/p>\n<div id=\"attachment_23744\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23744\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23744\" class=\"wp-caption-text\">Enable Secure Dynamic Updates<\/p>\n<\/div>\n<div id=\"attachment_23745\" class=\"wp-caption aligncenter\">\n<p><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\" aria-describedby=\"caption-attachment-23745\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23745\" 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>record 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>\u00a0query 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\">\n<p><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\" aria-describedby=\"caption-attachment-23746\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23746\" 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>console 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\">\n<p><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\" aria-describedby=\"caption-attachment-23747\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23747\" 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>\u00a0<strong>Windows Settings<\/strong><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\">\n<p><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\" aria-describedby=\"caption-attachment-23748\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23748\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23749\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23749\" 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\">\n<p><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\" aria-describedby=\"caption-attachment-23750\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23750\" 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<h1 class=\"post-title\">Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication \u2013 Part 5<\/h1>\n<p>This tutorial will show you how to add a second\u00a0<strong>Samba4<\/strong>\u00a0domain controller, provisioned on\u00a0<strong>Ubuntu 16.04<\/strong>\u00a0server, to the existing\u00a0<strong>Samba AD DC<\/strong>\u00a0forest in order to provide a degree of load balancing\/failover for some crucial AD DC services, especially for services such as DNS and AD DC LDAP schema with SAM database.<\/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 Active Directory Infrastructure with Samba4 on Ubuntu \u2013 Part 1<\/a><\/li>\n<\/ol>\n<p>This article is a\u00a0<strong>Part-5<\/strong>\u00a0of\u00a0<strong>Samba4 AD DC<\/strong>\u00a0series as follows:<\/p>\n<div id=\"exam_announcement\"><b>Part 2<\/b>:\u00a0<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<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 3<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-ad-from-windows-via-rsat\/\">Manage Samba4 Active Directory Infrastructure from Windows10 via RSAT<\/a><\/div>\n<div id=\"exam_announcement\"><b>Part 4<\/b>:\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-dns-group-policy-from-windows\/\">Manage Samba4 AD Domain Controller DNS and Group Policy from Windows<\/a><\/div>\n<h3>Step 1: Initial Configuration for Samba4 Setup<\/h3>\n<p><strong>1.<\/strong>\u00a0Before you start to actually perform domain joining for the second DC, you need to take care of few initial settings. First, make sure the\u00a0<strong>hostname<\/strong>\u00a0of the system which will be integrated into\u00a0<strong>Samba4 AD DC<\/strong>\u00a0contains a descriptive name.<\/p>\n<p>Assuming that the\u00a0<strong>hostname<\/strong>\u00a0of the first provisioned realm is called\u00a0<code>adc1<\/code>, you can name the second DC with\u00a0<code>adc2<\/code>\u00a0in order to provide a consistent naming scheme across your Domain Controllers.<\/p>\n<p>To change the system\u00a0<strong>hostname<\/strong>\u00a0you can issue the below command.<\/p>\n<pre># hostnamectl set-hostname adc2\r\n<\/pre>\n<p>else you can manually edit\u00a0<strong>\/etc\/hostname<\/strong>\u00a0file and add a new line with the desired name.<\/p>\n<pre># nano \/etc\/hostname\r\n<\/pre>\n<p>Here add the hostname.<\/p>\n<pre>adc2\r\n<\/pre>\n<p><strong>2.<\/strong>\u00a0Next, open local system resolution file and add an entry with the IP address witch points to the short name and\u00a0<strong>FQDN<\/strong>\u00a0of the main domain controller, as illustrated in the below screenshot.<\/p>\n<p>Through this tutorial, the primary DC name is\u00a0<code>adc1.tecmint.lan<\/code>\u00a0and it resolves to\u00a0<strong>192.168.1.254<\/strong>\u00a0IP address.<\/p>\n<pre># nano \/etc\/hosts\r\n<\/pre>\n<p>Add the following line:<\/p>\n<pre>IP_of_main_DC\t\tFQDN_of_main_DC \tshort_name_of_main_DC\r\n<\/pre>\n<div id=\"attachment_24075\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Set-Hostname-for-Samba4-AD-DC.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24075\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Set-Hostname-for-Samba4-AD-DC.jpg\" sizes=\"auto, (max-width: 809px) 100vw, 809px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Set-Hostname-for-Samba4-AD-DC.jpg 809w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Set-Hostname-for-Samba4-AD-DC-768x641.jpg 768w\" alt=\"Set Hostname for Samba4 AD DC\" width=\"809\" height=\"675\" aria-describedby=\"caption-attachment-24075\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24075\" class=\"wp-caption-text\">Set Hostname for Samba4 AD DC<\/p>\n<\/div>\n<p><strong>3.<\/strong>\u00a0On the next step, open\u00a0<strong>\/etc\/network\/interfaces<\/strong>\u00a0and assign a static IP address for your system as illustrated in the below screenshot.<\/p>\n<p>Pay attention to\u00a0<strong>dns-nameservers<\/strong>\u00a0and\u00a0<strong>dns-search<\/strong>\u00a0variables. These values should be configured to point back to the IP address of the primary\u00a0<strong>Samba4 AD DC<\/strong>\u00a0and realm in order for DNS resolution to work correctly.<\/p>\n<p>Restart the network daemon in order to reflect changes. Verify\u00a0<strong>\/etc\/resolv.conf<\/strong>\u00a0file to assure that both DNS values from your network interface are updated to this file.<\/p>\n<pre># nano \/etc\/network\/interfaces\r\n<\/pre>\n<p>Edit and replace with your custom IP settings:<\/p>\n<pre>auto ens33\r\niface ens33 inet static\r\n        address 192.168.1.253\r\n        netmask 255.255.255.0\r\n        brodcast 192.168.1.1\r\n        gateway 192.168.1.1\r\n        dns-nameservers 192.168.1.254\r\n        dns-search tecmint.lan\r\n<\/pre>\n<p>Restart network service and confirm changes.<\/p>\n<pre># systemctl restart networking.service\r\n# cat \/etc\/resolv.conf\r\n<\/pre>\n<div id=\"attachment_24076\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-DNS-for-Samba4-AD.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24076\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-DNS-for-Samba4-AD.jpg\" sizes=\"auto, (max-width: 1067px) 100vw, 1067px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-DNS-for-Samba4-AD.jpg 1067w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-DNS-for-Samba4-AD-768x576.jpg 768w\" alt=\"Configure DNS for Samba4 AD\" width=\"1067\" height=\"800\" aria-describedby=\"caption-attachment-24076\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24076\" class=\"wp-caption-text\">Configure DNS for Samba4 AD<\/p>\n<\/div>\n<p>The\u00a0<strong>dns-search<\/strong>\u00a0value will automatically append the domain name when you query a host by its short name (will form the FQDN).<\/p>\n<p><strong>4.<\/strong>\u00a0In order to test if DNS resolution is working as expected, issue a series of\u00a0<strong>ping<\/strong>\u00a0commands against your domain short name, FQDN and realm as shown in the below screenshot.<\/p>\n<p>In all these cases\u00a0<strong>Samba4 AD DC DNS<\/strong>\u00a0server should reply with the IP address of your main DC.<\/p>\n<div id=\"attachment_24077\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-DNS-Resolution-for-Samba4-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24077\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-DNS-Resolution-for-Samba4-AD.png\" alt=\"Verify DNS Resolution for Samba4 AD\" width=\"740\" height=\"456\" aria-describedby=\"caption-attachment-24077\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24077\" class=\"wp-caption-text\">Verify DNS Resolution for Samba4 AD<\/p>\n<\/div>\n<p><strong>5.<\/strong>\u00a0The final additional step that you need to take care off is time synchronization with your main Domain Controller. This can be accomplished by installing\u00a0<strong>NTP<\/strong>\u00a0client utility on your system by issuing the below command:<\/p>\n<pre># apt-get install ntpdate\r\n<\/pre>\n<p><strong>6.<\/strong>\u00a0Assuming that you want to manually force time synchronization with\u00a0<strong>samba4 AD DC<\/strong>, run\u00a0<strong>ntpdate<\/strong>\u00a0command against the primary DC by issuing the following command.<\/p>\n<pre># ntpdate adc1\r\n<\/pre>\n<div id=\"attachment_24078\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Time-Synchronize-with-Samba4-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24078\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Time-Synchronize-with-Samba4-AD.png\" alt=\"Time Synchronize with Samba4 AD\" width=\"713\" height=\"78\" aria-describedby=\"caption-attachment-24078\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24078\" class=\"wp-caption-text\">Time Synchronize with Samba4 AD<\/p>\n<\/div>\n<h3>Step 2: Install Samba4 with Required Dependencies<\/h3>\n<p><strong>7.<\/strong>\u00a0In order to enroll\u00a0<strong>Ubuntu 16.04<\/strong>\u00a0system into your domain, first install\u00a0<strong>Samba4<\/strong>,\u00a0<strong>Kerberos<\/strong>\u00a0client and a few other important packages for later use from Ubuntu official repositories by issuing the below command:<\/p>\n<pre># apt-get install samba krb5-user krb5-config winbind libpam-winbind libnss-winbind\r\n<\/pre>\n<div id=\"attachment_24080\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Install-Samba4-in-Ubuntu.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24080\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Install-Samba4-in-Ubuntu.png\" sizes=\"auto, (max-width: 1008px) 100vw, 1008px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Install-Samba4-in-Ubuntu.png 1008w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Install-Samba4-in-Ubuntu-768x361.png 768w\" alt=\"Install Samba4 in Ubuntu\" width=\"1008\" height=\"474\" aria-describedby=\"caption-attachment-24080\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24080\" class=\"wp-caption-text\">Install Samba4 in Ubuntu<\/p>\n<\/div>\n<p><strong>8.<\/strong>\u00a0During the installation you will need to provide Kerberos realm name. Write your domain name with upper cases and press\u00a0<strong>[Enter]<\/strong>\u00a0key to finish the installation process.<\/p>\n<div id=\"attachment_24081\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Kerberos-Authentication-for-Samba4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24081\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Kerberos-Authentication-for-Samba4.png\" sizes=\"auto, (max-width: 1006px) 100vw, 1006px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Kerberos-Authentication-for-Samba4.png 1006w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Kerberos-Authentication-for-Samba4-768x219.png 768w\" alt=\"Configure Kerberos Authentication for Samba4\" width=\"1006\" height=\"287\" aria-describedby=\"caption-attachment-24081\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24081\" class=\"wp-caption-text\">Configure Kerberos Authentication for Samba4<\/p>\n<\/div>\n<p><strong>9.<\/strong>\u00a0After the packages installation finishes, verify the settings by requesting a Kerberos ticket for a domain administrator using\u00a0<strong>kinit<\/strong>\u00a0command. Use\u00a0<strong>klist<\/strong>\u00a0command to list granted Kerberos ticket.<\/p>\n<pre># kinit domain-admin-user@YOUR_DOMAIN.TLD\r\n# klist\r\n<\/pre>\n<div id=\"attachment_24082\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Kerberos-on-Samba4-Domain.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24082\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Kerberos-on-Samba4-Domain.png\" sizes=\"auto, (max-width: 838px) 100vw, 838px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Kerberos-on-Samba4-Domain.png 838w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Kerberos-on-Samba4-Domain-768x289.png 768w\" alt=\"Verify Kerberos on Samba4 Domain\" width=\"838\" height=\"315\" aria-describedby=\"caption-attachment-24082\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24082\" class=\"wp-caption-text\">Verify Kerberos on Samba4 Domain<\/p>\n<\/div>\n<h3>Step 3: Join to Samba4 AD DC as a Domain Controller<\/h3>\n<p><strong>10.<\/strong>\u00a0Before integrating your machine into\u00a0<strong>Samba4 DC<\/strong>, first make sure all Samba4 daemons running on your system are stopped and, also, rename the default Samba configuration file in order to start clean. While provisioning the domain controller, samba will create a new configuration file from scratch.<\/p>\n<pre># systemctl stop samba-ad-dc smbd nmbd winbind\r\n# mv \/etc\/samba\/smb.conf \/etc\/samba\/smb.conf.initial\r\n<\/pre>\n<p><strong>11.<\/strong>\u00a0In order to start the domain joining process, first start only\u00a0<strong>samba-ad-dc<\/strong>\u00a0daemon, after which you will run\u00a0<strong>samba-tool<\/strong>\u00a0command to join the realm using an account with administrative privileges on your domain.<\/p>\n<pre># samba-tool domain join your_domain DC -U \"your_domain_admin\"\r\n<\/pre>\n<p>Domain integration excerpt:<\/p>\n<pre># samba-tool domain join tecmint.lan DC -U\"tecmint_user\"\r\n<\/pre>\n<h5>Sample Output<\/h5>\n<pre>Finding a writeable DC for domain 'tecmint.lan'\r\nFound DC adc1.tecmint.lan\r\nPassword for [WORKGROUP\\tecmint_user]:\r\nworkgroup is TECMINT\r\nrealm is tecmint.lan\r\nchecking sAMAccountName\r\nDeleted CN=ADC2,CN=Computers,DC=tecmint,DC=lan\r\nAdding CN=ADC2,OU=Domain Controllers,DC=tecmint,DC=lan\r\nAdding CN=ADC2,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=tecmint,DC=lan\r\nAdding CN=NTDS Settings,CN=ADC2,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=tecmint,DC=lan\r\nAdding SPNs to CN=ADC2,OU=Domain Controllers,DC=tecmint,DC=lan\r\nSetting account password for ADC2$\r\nEnabling account\r\nCalling bare provision\r\nLooking up IPv4 addresses\r\nLooking up IPv6 addresses\r\nNo IPv6 address will be assigned\r\nSetting up share.ldb\r\nSetting up secrets.ldb\r\nSetting up the registry\r\nSetting up the privileges database\r\nSetting up idmap db\r\nSetting up SAM db\r\nSetting up sam.ldb partitions and settings\r\nSetting up sam.ldb rootDSE\r\nPre-loading the Samba 4 and AD schema\r\nA Kerberos configuration suitable for Samba 4 has been generated at \/var\/lib\/samba\/private\/krb5.conf\r\nProvision OK for domain DN DC=tecmint,DC=lan\r\nStarting replication\r\nSchema-DN[CN=Schema,CN=Configuration,DC=tecmint,DC=lan] objects[402\/1550] linked_values[0\/0]\r\nSchema-DN[CN=Schema,CN=Configuration,DC=tecmint,DC=lan] objects[804\/1550] linked_values[0\/0]\r\nSchema-DN[CN=Schema,CN=Configuration,DC=tecmint,DC=lan] objects[1206\/1550] linked_values[0\/0]\r\nSchema-DN[CN=Schema,CN=Configuration,DC=tecmint,DC=lan] objects[1550\/1550] linked_values[0\/0]\r\nAnalyze and apply schema objects\r\nPartition[CN=Configuration,DC=tecmint,DC=lan] objects[402\/1614] linked_values[0\/0]\r\nPartition[CN=Configuration,DC=tecmint,DC=lan] objects[804\/1614] linked_values[0\/0]\r\nPartition[CN=Configuration,DC=tecmint,DC=lan] objects[1206\/1614] linked_values[0\/0]\r\nPartition[CN=Configuration,DC=tecmint,DC=lan] objects[1608\/1614] linked_values[0\/0]\r\nPartition[CN=Configuration,DC=tecmint,DC=lan] objects[1614\/1614] linked_values[28\/0]\r\nReplicating critical objects from the base DN of the domain\r\nPartition[DC=tecmint,DC=lan] objects[97\/97] linked_values[24\/0]\r\nPartition[DC=tecmint,DC=lan] objects[380\/283] linked_values[27\/0]\r\nDone with always replicated NC (base, config, schema)\r\nReplicating DC=DomainDnsZones,DC=tecmint,DC=lan\r\nPartition[DC=DomainDnsZones,DC=tecmint,DC=lan] objects[45\/45] linked_values[0\/0]\r\nReplicating DC=ForestDnsZones,DC=tecmint,DC=lan\r\nPartition[DC=ForestDnsZones,DC=tecmint,DC=lan] objects[18\/18] linked_values[0\/0]\r\nCommitting SAM database\r\nSending DsReplicaUpdateRefs for all the replicated partitions\r\nSetting isSynchronized and dsServiceName\r\nSetting up secrets database\r\nJoined domain TECMINT (SID S-1-5-21-715537322-3397311598-55032968) as a DC\r\n<\/pre>\n<div id=\"attachment_24084\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Join-Domain-to-Samba4-AD-DC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24084\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Join-Domain-to-Samba4-AD-DC.png\" sizes=\"auto, (max-width: 987px) 100vw, 987px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Join-Domain-to-Samba4-AD-DC.png 987w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Join-Domain-to-Samba4-AD-DC-768x528.png 768w\" alt=\"Join Domain to Samba4 AD DC\" width=\"987\" height=\"679\" aria-describedby=\"caption-attachment-24084\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24084\" class=\"wp-caption-text\">Join Domain to Samba4 AD DC<\/p>\n<\/div>\n<p><strong>12.<\/strong>\u00a0After the Ubuntu with samba4 software has been integrated into the domain, open samba main configuration file and add the following lines:<\/p>\n<pre># nano \/etc\/samba\/smb.conf\r\n<\/pre>\n<p>Add following excerpt to smb.conf file.<\/p>\n<pre>dns forwarder = 192.168.1.1\r\nidmap_ldb:use rfc2307 = yes\r\n\r\n   template shell = \/bin\/bash\r\n   winbind use default domain = true\r\n   winbind offline logon = false\r\n   winbind nss info = rfc2307\r\n        winbind enum users = yes\r\n        winbind enum groups = yes\r\n<\/pre>\n<p>Replace\u00a0<strong>dns forwarder IP<\/strong>\u00a0address with your own DNS forwarder IP. Samba will forward all DNS resolution queries that are outside your domain authoritative zone to this IP address.<\/p>\n<p><strong>13.<\/strong>\u00a0Finally, restart samba daemon to reflect changes and check active directory replication by executing the following commands.<\/p>\n<pre># systemctl restart samba-ad-dc\r\n# samba-tool drs showrepl\r\n<\/pre>\n<div id=\"attachment_24085\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Samba4-DNS.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24085\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Samba4-DNS.png\" sizes=\"auto, (max-width: 1034px) 100vw, 1034px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Samba4-DNS.png 1034w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Samba4-DNS-768x691.png 768w\" alt=\"Configure Samba4 DNS\" width=\"1034\" height=\"931\" aria-describedby=\"caption-attachment-24085\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24085\" class=\"wp-caption-text\">Configure Samba4 DNS<\/p>\n<\/div>\n<p><strong>14.<\/strong>\u00a0Additionally, rename initial Kerberos configuration file from\u00a0<strong>\/etc<\/strong>\u00a0path and replace it with the new\u00a0<strong>krb5.conf<\/strong>configuration file generated by samba while provisioning the domain.<\/p>\n<p>The file is located in\u00a0<strong>\/var\/lib\/samba\/private<\/strong>\u00a0directory. Use Linux symlink to link this file to\u00a0<strong>\/etc<\/strong>\u00a0directory.<\/p>\n<pre># mv \/etc\/krb5.conf \/etc\/krb5.conf.initial\r\n# ln -s \/var\/lib\/samba\/private\/krb5.conf \/etc\/\r\n# cat \/etc\/krb5.conf\r\n<\/pre>\n<div id=\"attachment_24086\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Kerberos.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24086\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Kerberos.jpg\" alt=\"Configure Kerberos\" width=\"720\" height=\"435\" aria-describedby=\"caption-attachment-24086\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24086\" class=\"wp-caption-text\">Configure Kerberos<\/p>\n<\/div>\n<p><strong>15.<\/strong>\u00a0Also, verify Kerberos authentication with samba\u00a0<strong>krb5.conf<\/strong>\u00a0file. Request a ticket for an administrator user and list the cached ticket by issuing the below commands.<\/p>\n<pre># kinit administrator\r\n# klist\r\n<\/pre>\n<div id=\"attachment_24087\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Kerberos-Authentication-with-Samba.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24087\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Kerberos-Authentication-with-Samba.jpg\" sizes=\"auto, (max-width: 843px) 100vw, 843px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Kerberos-Authentication-with-Samba.jpg 843w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Kerberos-Authentication-with-Samba-768x351.jpg 768w\" alt=\"Verify Kerberos Authentication with Samba\" width=\"843\" height=\"385\" aria-describedby=\"caption-attachment-24087\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24087\" class=\"wp-caption-text\">Verify Kerberos Authentication with Samba<\/p>\n<\/div>\n<h3>Step 4: Additional Domain Services Validations<\/h3>\n<p><strong>16.<\/strong>\u00a0The first test you need to perform is\u00a0<strong>Samba4 DC DNS<\/strong>\u00a0resolution. To validate your domain DNS resolution, query the domain name using\u00a0<strong>host<\/strong>\u00a0command against a few crucial AD DNS records as presented on the below screenshot.<\/p>\n<p>The DNS server should replay by now with a pair of two IP addresses for each query.<\/p>\n<pre># host your_domain.tld\r\n# host -t SRV _kerberos._udp.your_domain.tld  # UDP Kerberos SRV record\r\n# host -t SRV _ldap._tcp.your_domain.tld  # TCP LDAP SRV record\r\n<\/pre>\n<div id=\"attachment_24088\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Samba4-DC-DNS.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24088\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Samba4-DC-DNS.png\" alt=\"Verify Samba4 DC DNS\" width=\"671\" height=\"314\" aria-describedby=\"caption-attachment-24088\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24088\" class=\"wp-caption-text\">Verify Samba4 DC DNS<\/p>\n<\/div>\n<p><strong>17.<\/strong>\u00a0These DNS records should also be visible from an enrolled\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-ad-from-windows-via-rsat\/\" target=\"_blank\" rel=\"noopener\">Windows machine with RSAT tools installed<\/a>. Open DNS Manager and expand to your domain tcp records as shown in the below image.<\/p>\n<div id=\"attachment_24089\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-DNS-Records-on-Windows-RSAT-Tool.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24089\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-DNS-Records-on-Windows-RSAT-Tool.png\" sizes=\"auto, (max-width: 995px) 100vw, 995px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-DNS-Records-on-Windows-RSAT-Tool.png 995w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-DNS-Records-on-Windows-RSAT-Tool-768x285.png 768w\" alt=\"Verify DNS Records on Windows RSAT Tool\" width=\"995\" height=\"369\" aria-describedby=\"caption-attachment-24089\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24089\" class=\"wp-caption-text\">Verify DNS Records on Windows RSAT Tool<\/p>\n<\/div>\n<p><strong>18.<\/strong>\u00a0The next test should indicate if domain LDAP replication works as expected. Using\u00a0<strong>samba-tool<\/strong>, create an account on the second domain controller and verify if the account is automatically replicated on the first Samba4 AD DC.<\/p>\n<h5>On adc2:<\/h5>\n<pre># samba-tool user add test_user\r\n<\/pre>\n<h5>On adc1:<\/h5>\n<pre># samba-tool user list | grep test_user\r\n<\/pre>\n<div id=\"attachment_24090\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Create-User-Account-on-Samba4-AD.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24090\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Create-User-Account-on-Samba4-AD.jpg\" alt=\"Create User Account on Samba4 AD\" width=\"529\" height=\"248\" aria-describedby=\"caption-attachment-24090\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24090\" class=\"wp-caption-text\">Create User Account on Samba4 AD<\/p>\n<\/div>\n<div id=\"attachment_24091\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Replication-on-Samba4-AD.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24091\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Replication-on-Samba4-AD.jpg\" alt=\"Verify Replication on Samba4 AD\" width=\"576\" height=\"255\" aria-describedby=\"caption-attachment-24091\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24091\" class=\"wp-caption-text\">Verify Replication on Samba4 AD<\/p>\n<\/div>\n<p><strong>19.<\/strong>\u00a0You can also create an account from a\u00a0<strong>Microsoft AD UC<\/strong>\u00a0console and verify if the account appears on both domain controllers.<\/p>\n<p>By default, the account should be automatically created on both samba domain controllers. Query the account name from\u00a0<code>adc1<\/code>\u00a0using\u00a0<strong>wbinfo<\/strong>\u00a0command.<\/p>\n<div id=\"attachment_24092\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Create-Account-from-Microsoft-AD-UC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24092\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Create-Account-from-Microsoft-AD-UC.png\" sizes=\"auto, (max-width: 914px) 100vw, 914px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Create-Account-from-Microsoft-AD-UC.png 914w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Create-Account-from-Microsoft-AD-UC-768x438.png 768w\" alt=\"Create Account from Microsoft AD UC\" width=\"914\" height=\"521\" aria-describedby=\"caption-attachment-24092\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24092\" class=\"wp-caption-text\">Create Account from Microsoft AD UC<\/p>\n<\/div>\n<div id=\"attachment_24093\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Account-Replication-On-Samba4-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24093\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Account-Replication-On-Samba4-AD.png\" alt=\"Verify Account Replication On Samba4 AD\" width=\"464\" height=\"136\" aria-describedby=\"caption-attachment-24093\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24093\" class=\"wp-caption-text\">Verify Account Replication On Samba4 AD<\/p>\n<\/div>\n<p><strong>20.<\/strong>\u00a0As a fact, open\u00a0<strong>AD UC<\/strong>\u00a0console from Windows, expand to Domain Controllers and you should see both enrolled DC machines.<\/p>\n<div id=\"attachment_24094\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Samba4-Domain-Controllers.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24094\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Samba4-Domain-Controllers.png\" sizes=\"auto, (max-width: 911px) 100vw, 911px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Samba4-Domain-Controllers.png 911w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Samba4-Domain-Controllers-768x317.png 768w\" alt=\"Verify Samba4 Domain Controllers\" width=\"911\" height=\"376\" aria-describedby=\"caption-attachment-24094\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24094\" class=\"wp-caption-text\">Verify Samba4 Domain Controllers<\/p>\n<\/div>\n<h3>Step 5: Enable Samba4 AD DC Service<\/h3>\n<p><strong>21.<\/strong>\u00a0In order to enable samba4 AD DC services system-wide, first disable some old and unused Samba daemons and enable only\u00a0<strong>samba-ad-dc<\/strong>\u00a0service by running the below commands:<\/p>\n<pre># systemctl disable smbd nmbd winbind\r\n# systemctl enable samba-ad-dc\r\n<\/pre>\n<div id=\"attachment_24095\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Enable-Samba4-AD-DC-Services.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24095\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Enable-Samba4-AD-DC-Services.png\" sizes=\"auto, (max-width: 997px) 100vw, 997px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Enable-Samba4-AD-DC-Services.png 997w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Enable-Samba4-AD-DC-Services-768x287.png 768w\" alt=\"Enable Samba4 AD DC Services\" width=\"997\" height=\"373\" aria-describedby=\"caption-attachment-24095\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24095\" class=\"wp-caption-text\">Enable Samba4 AD DC Services<\/p>\n<\/div>\n<p><strong>22.<\/strong>\u00a0If you remotely administer Samba4 domain controller from a Microsoft client or you have other Linux or Windows clients integrated into your domain, make sure you mention the IP address of the\u00a0<code>adc2<\/code>\u00a0machine to their network interface DNS server IP settings in order to gain a level of redundancy.<\/p>\n<p>The below screenshots illustrates the configurations required for a Windows or a Debian\/Ubuntu client.<\/p>\n<div id=\"attachment_24097\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Client-to-Administer-Samba4-DC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24097\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Client-to-Administer-Samba4-DC.png\" sizes=\"auto, (max-width: 863px) 100vw, 863px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Client-to-Administer-Samba4-DC.png 863w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Client-to-Administer-Samba4-DC-768x551.png 768w\" alt=\"Configure Client to Administer Samba4 DC\" width=\"863\" height=\"619\" aria-describedby=\"caption-attachment-24097\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24097\" class=\"wp-caption-text\">Configure Client to Administer Samba4 DC<\/p>\n<\/div>\n<div id=\"attachment_24098\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Linux-Client-to-Administer-Samba4-DC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24098\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-Linux-Client-to-Administer-Samba4-DC.png\" alt=\"Configure Linux Client to Administer Samba4 DC\" width=\"597\" height=\"337\" aria-describedby=\"caption-attachment-24098\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24098\" class=\"wp-caption-text\">Configure Linux Client to Administer Samba4 DC<\/p>\n<\/div>\n<p>Assuming that the first\u00a0<strong>DC<\/strong>\u00a0with\u00a0<strong>192.168.1.254<\/strong>\u00a0goes offline, reverse the order of the DNS server IP addresses in the configuration file so it won\u2019t try to query first an unavailable DNS server.<\/p>\n<p>Finally, in case you want to perform local authentication on a Linux system with a Samba4 Active Directory account or grant root privileges for AD LDAP accounts in Linux, read the steps 2 and 3 from the tutorial\u00a0<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<\/a>.<\/p>\n<h1 class=\"post-title\">Setup SysVol Replication Across Two Samba4 AD DC with Rsync \u2013 Part 6<\/h1>\n<p>This topic will cover\u00a0<strong>SysVol<\/strong>\u00a0replication across two\u00a0<strong>Samba4 Active Directory Domain Controllers<\/strong>\u00a0performed with the help of a few powerful Linux tools, such as\u00a0<a href=\"https:\/\/www.tecmint.com\/rsync-local-remote-file-synchronization-commands\/\" target=\"_blank\" rel=\"noopener\">Rsync file synchronization utility<\/a>,\u00a0<a href=\"https:\/\/www.tecmint.com\/11-cron-scheduling-task-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">Cron scheduling daemon<\/a>\u00a0and\u00a0<a href=\"https:\/\/www.tecmint.com\/5-best-practices-to-secure-and-protect-ssh-server\/\" target=\"_blank\" rel=\"noopener\">SSH protocol<\/a>.<\/p>\n<h4>Requirements:<\/h4>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/join-additional-ubuntu-dc-to-samba4-ad-dc-failover-replication\/\" target=\"_blank\" rel=\"noopener\">Join Ubuntu 16.04 as Additional Domain Controller to Samba4 AD DC \u2013 Part 5<\/a><\/li>\n<\/ol>\n<h3>Step 1: Accurate Time Synchronization Across DCs<\/h3>\n<p><strong>1.<\/strong>\u00a0Before starting to replicate the contents of the\u00a0<strong>sysvol<\/strong>\u00a0directory across both domain controllers you need to provide an accurate time for these machines.<\/p>\n<p>If the delay is greater than 5 minutes on both directions and their clocks are not properly in sync, you should start experiencing various problems with AD accounts and domain replication.<\/p>\n<p>To overcome the problem of time drifting between two or more domain controllers, you need to\u00a0<a href=\"https:\/\/www.tecmint.com\/install-and-configure-ntp-server-client-in-debian\/\" target=\"_blank\" rel=\"noopener\">install and configure NTP server<\/a>\u00a0on your machine by executing the below command.<\/p>\n<pre># apt-get install ntp\r\n<\/pre>\n<p><strong>2.<\/strong>\u00a0After NTP daemon has been installed, open the main configuration file, comment the default pools (add a\u00a0<strong>#<\/strong>\u00a0in front of each pool line) and add a new pool which will point back to the main\u00a0<strong>Samba4 AD DC FQDN<\/strong>\u00a0with\u00a0<strong>NTP<\/strong>server installed, as suggested on the below example.<\/p>\n<pre># nano \/etc\/ntp.conf\r\n<\/pre>\n<p>Add following lines to\u00a0<strong>ntp.conf<\/strong>\u00a0file.<\/p>\n<pre>pool 0.ubuntu.pool.ntp.org iburst\r\n#pool 1.ubuntu.pool.ntp.org iburst\r\n#pool 2.ubuntu.pool.ntp.org iburst\r\n#pool 3.ubuntu.pool.ntp.org iburst\r\n\r\npool adc1.tecmint.lan\r\n\r\n# Use Ubuntu's ntp server as a fallback.\r\npool ntp.ubuntu.com\r\n<\/pre>\n<div id=\"attachment_24194\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-NTP-for-Samba4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24194\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-NTP-for-Samba4.png\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-NTP-for-Samba4.png 800w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Configure-NTP-for-Samba4-768x576.png 768w\" alt=\"Configure NTP for Samba4\" width=\"800\" height=\"600\" aria-describedby=\"caption-attachment-24194\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24194\" class=\"wp-caption-text\">Configure NTP for Samba4<\/p>\n<\/div>\n<p><strong>3.<\/strong>\u00a0Don\u2019t close the file yet, move to the bottom of the file and add the following lines in order for other clients to be able to query and\u00a0<a href=\"https:\/\/www.tecmint.com\/how-to-synchronize-time-with-ntp-server-in-ubuntu-linux-mint-xubuntu-debian\/\" target=\"_blank\" rel=\"noopener\">sync the time with this NTP server<\/a>, issuing signed NTP requests, in case the primary DC goes offline:<\/p>\n<pre>restrict source notrap nomodify noquery mssntp\r\nntpsigndsocket \/var\/lib\/samba\/ntp_signd\/\r\n<\/pre>\n<p><strong>4.<\/strong>\u00a0Finally, save and close the configuration file and restart NTP daemon in order to apply the changes. Wait for a few seconds or minutes for the time to synchronize and issue\u00a0<strong>ntpq<\/strong>\u00a0command in order to print the current summary state of the\u00a0<strong>adc1<\/strong>\u00a0peer in sync.<\/p>\n<pre># systemctl restart ntp\r\n# ntpq -p\r\n<\/pre>\n<div id=\"attachment_24195\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Synchronize-Time.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24195\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Synchronize-Time.png\" alt=\"Synchronize NTP Time with Samba4 AD\" width=\"629\" height=\"156\" aria-describedby=\"caption-attachment-24195\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24195\" class=\"wp-caption-text\">Synchronize NTP Time with Samba4 AD<\/p>\n<\/div>\n<h3>Step 2: SysVol Replication with First DC via Rsync<\/h3>\n<p>By default,\u00a0<strong>Samba4 AD DC<\/strong>\u00a0doesn\u2019t perform\u00a0<strong>SysVol<\/strong>\u00a0replication via\u00a0<strong>DFS-R<\/strong>\u00a0(<strong>Distributed File System Replication<\/strong>) or the\u00a0<strong>FRS<\/strong>\u00a0(<strong>File Replication Service<\/strong>).<\/p>\n<p>This means that\u00a0<strong>Group Policy<\/strong>\u00a0objects are available only if the first domain controller is online. If the first DC becomes unavailable, the Group Policy settings and logon scripts will not apply further on Windows machines enrolled into the domain.<\/p>\n<p>To overcome this obstacle and achieve a rudimentary form of SysVol replication we will schedule a\u00a0<a href=\"https:\/\/www.tecmint.com\/rsync-local-remote-file-synchronization-commands\/\" target=\"_blank\" rel=\"noopener\">Linux rsync command<\/a>\u00a0combined with a SSH encrypted tunnel with\u00a0<a href=\"https:\/\/www.tecmint.com\/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps\/\" target=\"_blank\" rel=\"noopener\">key-based SSH authentication<\/a>\u00a0in order to securely transfer\u00a0<strong>GPO<\/strong>\u00a0objects from the first domain controller to the second domain controller.<\/p>\n<p>This method ensures\u00a0<strong>GPO<\/strong>\u00a0objects consistency across domain controllers, but has one huge drawback. It works only in one direction because\u00a0<strong>rsync<\/strong>\u00a0will transfer all changes from the source DC to the destination DC when synchronizing GPO directories.<\/p>\n<p>Objects which no longer exist on the source will be deleted from the destination as well. In order to limit and avoid any conflicts, all GPO edits should be made only on the first DC.<\/p>\n<p><strong>5.<\/strong>\u00a0To start the process of\u00a0<strong>SysVol<\/strong>\u00a0replication, first\u00a0<a href=\"https:\/\/www.tecmint.com\/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps\/\" target=\"_blank\" rel=\"noopener\">generate a SSH key on the first Samba AD DC<\/a>\u00a0and transfer the key to the second DC by issuing the below commands.<\/p>\n<p>Do not use a\u00a0<strong>passphrase<\/strong>\u00a0for this key in order for the scheduled transfer to run without user interference.<\/p>\n<pre># ssh-keygen -t RSA  \r\n# ssh-copy-id root@adc2  \r\n# ssh adc2 \r\n# exit \r\n<\/pre>\n<div id=\"attachment_24196\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Generate-SSH-Key.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24196\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Generate-SSH-Key.png\" sizes=\"auto, (max-width: 991px) 100vw, 991px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Generate-SSH-Key.png 991w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Generate-SSH-Key-768x573.png 768w\" alt=\"Generate SSH Key on Samba4 DC\" width=\"991\" height=\"740\" aria-describedby=\"caption-attachment-24196\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24196\" class=\"wp-caption-text\">Generate SSH Key on Samba4 DC<\/p>\n<\/div>\n<p><strong>6.<\/strong>\u00a0After you\u2019ve assured that the root user from the first\u00a0<strong>DC<\/strong>\u00a0can automatically login on the second\u00a0<strong>DC<\/strong>, run the following\u00a0<strong>Rsync<\/strong>\u00a0command with\u00a0<code>--dry-run<\/code>\u00a0parameter in order simulate SysVol replication. Replace\u00a0<strong>adc2<\/strong>accordingly.<\/p>\n<pre># rsync --dry-run -XAavz --chmod=775 --delete-after  --progress --stats  \/var\/lib\/samba\/sysvol\/ root@adc2:\/var\/lib\/samba\/sysvol\/\r\n<\/pre>\n<p><strong>7.<\/strong>\u00a0If the simulation process works as expected, run the rsync command again without the\u00a0<code>--dry-run<\/code>\u00a0option in order to actually replicate GPO objects across your domain controllers.<\/p>\n<pre># rsync -XAavz --chmod=775 --delete-after  --progress --stats  \/var\/lib\/samba\/sysvol\/ root@adc2:\/var\/lib\/samba\/sysvol\/\r\n<\/pre>\n<div id=\"attachment_24197\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/SysVol-Replication-for-Samba4-DC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24197\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/SysVol-Replication-for-Samba4-DC.png\" sizes=\"auto, (max-width: 1081px) 100vw, 1081px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/SysVol-Replication-for-Samba4-DC.png 1081w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/SysVol-Replication-for-Samba4-DC-768x539.png 768w\" alt=\"Samba4 AD DC SysVol Replication\" width=\"1081\" height=\"758\" aria-describedby=\"caption-attachment-24197\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24197\" class=\"wp-caption-text\">Samba4 AD DC SysVol Replication<\/p>\n<\/div>\n<p><strong>8.<\/strong>\u00a0After SysVol replication process has finished, login to the destination domain controller and list the contents of one of the GPO objects directory by running the below command.<\/p>\n<p>The same GPO objects from the first DC should be replicated here too.<\/p>\n<pre># ls -alh \/var\/lib\/samba\/sysvol\/your_domain\/Policiers\/\r\n<\/pre>\n<div id=\"attachment_24198\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Samba4-DC-SysVol-Replication.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24198\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Samba4-DC-SysVol-Replication.png\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Samba4-DC-SysVol-Replication.png 975w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Verify-Samba4-DC-SysVol-Replication-768x261.png 768w\" alt=\"Verify Samba4 DC SysVol Replication\" width=\"975\" height=\"331\" aria-describedby=\"caption-attachment-24198\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24198\" class=\"wp-caption-text\">Verify Samba4 DC SysVol Replication<\/p>\n<\/div>\n<p><strong>9.<\/strong>\u00a0To automate the process of\u00a0<strong>Group Policy<\/strong>\u00a0replication (sysvol directory transport over network), schedule a root job to run the rsync command used earlier every 5 minutes by issuing the below command.<\/p>\n<pre># crontab -e \r\n<\/pre>\n<p>Add rsync command to run every 5 minutes and direct the output of the command, including the errors, to the log file\u00a0<strong>\/var\/log\/sysvol-replication.log<\/strong>\u00a0.In case something doesn\u2019t work as expected you should consult this file in order to troubleshoot the problem.<\/p>\n<pre>*\/5 * * * * rsync -XAavz --chmod=775 --delete-after  --progress --stats  \/var\/lib\/samba\/sysvol\/ root@adc2:\/var\/lib\/samba\/sysvol\/ &gt; \/var\/log\/sysvol-replication.log 2&gt;&amp;1\r\n<\/pre>\n<p><strong>10.<\/strong>\u00a0Assuming that in future there will be some related issues with\u00a0<strong>SysVol ACL<\/strong>\u00a0permissions, you can run the following commands in order to detect and repair these errors.<\/p>\n<pre># samba-tool ntacl sysvolcheck\r\n# samba-tool ntacl sysvolreset\r\n<\/pre>\n<div id=\"attachment_24199\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Fix-SysVol-ACL-Permissions.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24199\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Fix-SysVol-ACL-Permissions.png\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Fix-SysVol-ACL-Permissions.png 800w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Fix-SysVol-ACL-Permissions-768x576.png 768w\" alt=\"Fix SysVol ACL Permissions\" width=\"800\" height=\"600\" aria-describedby=\"caption-attachment-24199\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24199\" class=\"wp-caption-text\">Fix SysVol ACL Permissions<\/p>\n<\/div>\n<p><strong>11.<\/strong>\u00a0In case the first\u00a0<strong>Samba4 AD DC<\/strong>\u00a0with\u00a0<strong>FSMO<\/strong>\u00a0role as \u201c<strong>PDC Emulator<\/strong>\u201d becomes unavailable, you can force the\u00a0<strong>Group Policy Management Console<\/strong>\u00a0installed on a\u00a0<strong>Microsoft Windows<\/strong>\u00a0system to connect only to the second domain controller by choosing Change Domain Controller option and manually selecting the target machine as illustrated below.<\/p>\n<div id=\"attachment_24200\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Change-Samba4-Domain-Controller.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24200\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Change-Samba4-Domain-Controller.png\" sizes=\"auto, (max-width: 893px) 100vw, 893px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Change-Samba4-Domain-Controller.png 893w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Change-Samba4-Domain-Controller-768x540.png 768w\" alt=\"Change Samba4 Domain Controller\" width=\"893\" height=\"628\" aria-describedby=\"caption-attachment-24200\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24200\" class=\"wp-caption-text\">Change Samba4 Domain Controller<\/p>\n<\/div>\n<div id=\"attachment_24201\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Select-Samba4-Domain-Controller.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24201\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Select-Samba4-Domain-Controller.png\" sizes=\"auto, (max-width: 890px) 100vw, 890px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Select-Samba4-Domain-Controller.png 890w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Select-Samba4-Domain-Controller-768x540.png 768w\" alt=\"Select Samba4 Domain Controller\" width=\"890\" height=\"626\" aria-describedby=\"caption-attachment-24201\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24201\" class=\"wp-caption-text\">Select Samba4 Domain Controller<\/p>\n<\/div>\n<p>While connected to the second\u00a0<strong>DC<\/strong>\u00a0from\u00a0<strong>Group Policy Management Console<\/strong>, you should avoid making any modification to your domain\u00a0<strong>Group Policy<\/strong>. When the first\u00a0<strong>DC\u00a0<\/strong>will become available again,\u00a0<strong>rsync command<\/strong>\u00a0will destroy all changes made on this second domain controller.<\/p>\n<h1 class=\"post-title\">Create a Shared Directory on Samba AD DC and Map to Windows\/Linux Clients \u2013 Part 7<\/h1>\n<p>This tutorial will guide you on how to create a shared directory on\u00a0<strong>Samba AD DC<\/strong>\u00a0system, map this Shared Volume to Windows clients integrated into the domain via GPO and manage share permissions from Windows domain controller perspective.<\/p>\n<p>It will also cover how to access and mount the file share from a Linux machine enrolled into domain using a Samba4 domain account.<\/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 Active Directory Infrastructure with Samba4 on Ubuntu<\/a><\/li>\n<\/ol>\n<h3>Step 1: Create Samba File Share<\/h3>\n<p><strong>1.<\/strong>\u00a0The process of creating a share on\u00a0<strong>Samba AD DC<\/strong>\u00a0is a very simple task. First create a directory you want to share via SMB protocol and add the below permissions on the filesystem in order to allow a\u00a0<strong>Windows AD DC<\/strong>admin acount to modify the share permissions accordingly to what permissions Windows clients should see.<\/p>\n<p>Assuming that the new file share on the\u00a0<strong>AD DC<\/strong>\u00a0would be the\u00a0<code>\/nas<\/code>\u00a0directory, run the below commands to assign the correct permissions.<\/p>\n<pre># mkdir \/nas\r\n# chmod -R 775 \/nas\r\n# chown -R root:\"domain users\" \/nas\r\n# ls -alh | grep nas\r\n<\/pre>\n<div id=\"attachment_24709\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Create-Samba-Shared-Directory.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24709\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Create-Samba-Shared-Directory.png\" alt=\"Create Samba Shared Directory\" width=\"430\" height=\"110\" aria-describedby=\"caption-attachment-24709\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24709\" class=\"wp-caption-text\">Create Samba Shared Directory<\/p>\n<\/div>\n<p><strong>2.<\/strong>\u00a0After you\u2019ve created the directory that will be exported as a share from\u00a0<strong>Samba4 AD DC<\/strong>, you need to add the following statements to samba configuration file in order to make the share available via SMB protocol.<\/p>\n<pre># nano \/etc\/samba\/smb.conf\r\n<\/pre>\n<p>Go to the bottom of the file and add the following lines:<\/p>\n<pre>[nas]\r\n\tpath = \/nas\r\n\tread only = no\r\n<\/pre>\n<div id=\"attachment_24710\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Configure-Samba-Shared-Directory.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24710\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Configure-Samba-Shared-Directory.png\" alt=\"Configure Samba Shared Directory\" width=\"759\" height=\"534\" aria-describedby=\"caption-attachment-24710\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24710\" class=\"wp-caption-text\">Configure Samba Shared Directory<\/p>\n<\/div>\n<p><strong>3.<\/strong>\u00a0The last thing you need to do is to restart\u00a0<strong>Samba AD DC<\/strong>\u00a0daemon in order to apply the changes by issuing the below command:<\/p>\n<pre># systemctl restart samba-ad-dc.service\r\n<\/pre>\n<h3>Step 2: Manage Samba Share Permissions<\/h3>\n<p><strong>4.<\/strong>\u00a0Since we\u2019re accessing this shared volume from Windows, using domain accounts (users and groups) that are created on\u00a0<strong>Samba AD DC<\/strong>\u00a0(the share is not meant to be accessed by Linux system users).<\/p>\n<p>The process of managing permissions can be done directly from\u00a0<strong>Windows Explorer<\/strong>, in the same way permissions are managed for any folder in Windows Explorer.<\/p>\n<p>First, log on to Windows machine with a\u00a0<strong>Samba4 AD<\/strong>\u00a0account with administrative privileges on the domain. In order to access the share from Windows and set the permissions, type the IP address or host name or FQDN of the Samba AD DC machine in Windows Explorer path field, preceded by two back slashes, and the share should be visible.<\/p>\n<pre>\\adc1\r\nOr\r\n\\192.168.1.254\r\nOr\r\n\\adc1.tecmint.lan\r\n<\/pre>\n<div id=\"attachment_24711\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Access-Samba-Share-Directory-from-Windows.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24711\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Access-Samba-Share-Directory-from-Windows.png\" sizes=\"auto, (max-width: 966px) 100vw, 966px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Access-Samba-Share-Directory-from-Windows.png 966w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Access-Samba-Share-Directory-from-Windows-768x325.png 768w\" alt=\"Access Samba Share Directory from Windows\" width=\"966\" height=\"409\" aria-describedby=\"caption-attachment-24711\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24711\" class=\"wp-caption-text\">Access Samba Share Directory from Windows<\/p>\n<\/div>\n<p><strong>5.<\/strong>\u00a0To modify permissions just right click on the share and choose\u00a0<strong>Properties<\/strong>. Navigate to\u00a0<strong>Security<\/strong>\u00a0tab and proceed with altering domain users and group permissions accordingly. Use\u00a0<strong>Advanced<\/strong>\u00a0button in order to fine tune permissions.<\/p>\n<div id=\"attachment_24712\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Configure-Samba-Share-Directory-Permissions.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24712\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Configure-Samba-Share-Directory-Permissions.png\" sizes=\"auto, (max-width: 889px) 100vw, 889px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Configure-Samba-Share-Directory-Permissions.png 889w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Configure-Samba-Share-Directory-Permissions-768x512.png 768w\" alt=\"Configure Samba Share Directory Permissions\" width=\"889\" height=\"593\" aria-describedby=\"caption-attachment-24712\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24712\" class=\"wp-caption-text\">Configure Samba Share Directory Permissions<\/p>\n<\/div>\n<p>Use the below screenshot as an excerpt on how to tune permissions for specific\u00a0<strong>Samba AD DC<\/strong>\u00a0authenticated accounts.<\/p>\n<div id=\"attachment_24713\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Manage-Samba-Share-Directory-User-Permissions.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24713\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Manage-Samba-Share-Directory-User-Permissions.png\" sizes=\"auto, (max-width: 814px) 100vw, 814px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Manage-Samba-Share-Directory-User-Permissions.png 814w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Manage-Samba-Share-Directory-User-Permissions-768x622.png 768w\" alt=\"Manage Samba Share Directory User Permissions\" width=\"814\" height=\"659\" aria-describedby=\"caption-attachment-24713\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24713\" class=\"wp-caption-text\">Manage Samba Share Directory User Permissions<\/p>\n<\/div>\n<p><strong>6.<\/strong>\u00a0Other method you can use to manage the share permissions is from\u00a0<strong>Computer Management -&gt; Connect<\/strong>\u00a0to another computer.<\/p>\n<p>Navigate to\u00a0<strong>Shares<\/strong>, right click on the share you want to modify permissions, choose\u00a0<strong>Properties<\/strong>\u00a0and move to\u00a0<strong>Security<\/strong>\u00a0tab. From here you can alter permissions in any way you want just as presented in the previous method using file share permissions.<\/p>\n<div id=\"attachment_24715\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Connect-to-Samba-Share-Directory-Machine.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24715\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Connect-to-Samba-Share-Directory-Machine.png\" alt=\"Connect to Samba Share Directory Machine\" width=\"657\" height=\"358\" aria-describedby=\"caption-attachment-24715\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24715\" class=\"wp-caption-text\">Connect to Samba Share Directory Machine<\/p>\n<\/div>\n<div id=\"attachment_24714\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Manage-Samba-Share-Directory-Properties.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24714\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Manage-Samba-Share-Directory-Properties.png\" alt=\"Manage Samba Share Directory Properties\" width=\"711\" height=\"375\" aria-describedby=\"caption-attachment-24714\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24714\" class=\"wp-caption-text\">Manage Samba Share Directory Properties<\/p>\n<\/div>\n<div id=\"attachment_24716\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Assign-Samba-Share-Directory-Permissions-to-Users.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24716\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Assign-Samba-Share-Directory-Permissions-to-Users.png\" alt=\"Assign Samba Share Directory Permissions to Users\" width=\"648\" height=\"557\" aria-describedby=\"caption-attachment-24716\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24716\" class=\"wp-caption-text\">Assign Samba Share Directory Permissions to Users<\/p>\n<\/div>\n<h3>Step 3: Map the Samba File Share via GPO<\/h3>\n<p><strong>7.<\/strong>\u00a0To automatically mount the exported samba file share via domain\u00a0<strong>Group Policy<\/strong>, first on a machine with\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-ad-from-windows-via-rsat\/\" target=\"_blank\" rel=\"noopener\">RSAT tools installed<\/a>, open\u00a0<strong>AD UC<\/strong>\u00a0utility, right click on your domain name and, then, choose\u00a0<strong>New -&gt; Shared Folder<\/strong>.<\/p>\n<div id=\"attachment_24717\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Map-Samba-Share-Folder.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24717\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Map-Samba-Share-Folder.png\" sizes=\"auto, (max-width: 929px) 100vw, 929px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Map-Samba-Share-Folder.png 929w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Map-Samba-Share-Folder-768x507.png 768w\" alt=\"Map Samba Share Folder\" width=\"929\" height=\"613\" aria-describedby=\"caption-attachment-24717\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24717\" class=\"wp-caption-text\">Map Samba Share Folder<\/p>\n<\/div>\n<p><strong>8.<\/strong>\u00a0Add a name for the shared volume and enter the network path where your share is located as illustrated on the below image. Hit\u00a0<strong>OK<\/strong>\u00a0when you\u2019ve finished and the share should now be visible on the right plane.<\/p>\n<div id=\"attachment_24718\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Set-Samba-Shared-Folder-Name-Location.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24718\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Set-Samba-Shared-Folder-Name-Location.png\" alt=\"Set Samba Shared Folder Name Location\" width=\"678\" height=\"484\" aria-describedby=\"caption-attachment-24718\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24718\" class=\"wp-caption-text\">Set Samba Shared Folder Name Location<\/p>\n<\/div>\n<p><strong>9.<\/strong>\u00a0Next, open\u00a0<strong>Group Policy Management<\/strong>\u00a0console, expand to your domain\u00a0<strong>Default Domain Policy<\/strong>\u00a0script and open the file for editing.<\/p>\n<p>On the\u00a0<strong>GPM Editor<\/strong>\u00a0navigate to\u00a0<strong>User Configuration -&gt; Preferences -&gt; Windows Settings<\/strong>\u00a0and right click on\u00a0<strong>Drive Maps<\/strong>\u00a0and choose\u00a0<strong>New -&gt; Mapped Drive<\/strong>.<\/p>\n<div id=\"attachment_24719\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Map-Samba-Share-Folder-in-Windows.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24719\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Map-Samba-Share-Folder-in-Windows.png\" sizes=\"auto, (max-width: 1085px) 100vw, 1085px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Map-Samba-Share-Folder-in-Windows.png 1085w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Map-Samba-Share-Folder-in-Windows-768x440.png 768w\" alt=\"Map Samba Share Folder in Windows\" width=\"1085\" height=\"621\" aria-describedby=\"caption-attachment-24719\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24719\" class=\"wp-caption-text\">Map Samba Share Folder in Windows<\/p>\n<\/div>\n<p><strong>10.<\/strong>\u00a0On the new window search and add the network location for the share by pressing the right button with three dots, check\u00a0<strong>Reconnect<\/strong>\u00a0checkbox, add a label for this share, choose the letter for this drive and hit\u00a0<strong>OK<\/strong>\u00a0button to save and apply configuration.<\/p>\n<div id=\"attachment_24720\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Configure-Network-Location-for-Samba-Share-Directory.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24720\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Configure-Network-Location-for-Samba-Share-Directory.png\" sizes=\"auto, (max-width: 1077px) 100vw, 1077px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Configure-Network-Location-for-Samba-Share-Directory.png 1077w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Configure-Network-Location-for-Samba-Share-Directory-768x434.png 768w\" alt=\"Configure Network Location for Samba Share Directory\" width=\"1077\" height=\"608\" aria-describedby=\"caption-attachment-24720\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24720\" class=\"wp-caption-text\">Configure Network Location for Samba Share Directory<\/p>\n<\/div>\n<p><strong>11.<\/strong>\u00a0Finally, in order to force and apply\u00a0<strong>GPO<\/strong>\u00a0changes on your local machine without a system restart, open a\u00a0<strong>Command Prompt<\/strong>\u00a0and run the following command.<\/p>\n<pre>gpupdate \/force\r\n<\/pre>\n<div id=\"attachment_24721\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Apply-GPO-Changes.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24721\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Apply-GPO-Changes.png\" alt=\"Apply GPO Changes\" width=\"672\" height=\"414\" aria-describedby=\"caption-attachment-24721\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24721\" class=\"wp-caption-text\">Apply GPO Changes<\/p>\n<\/div>\n<p><strong>12.<\/strong>\u00a0After the policy has been successfully applied on your machine, open\u00a0<strong>Windows Explorer<\/strong>\u00a0and the shared network volume should be visible and accessible, depending on what permissions you\u2019ve granted for the share on previous steps.<\/p>\n<p>The share will be visible for other clients on your network after they reboot or re-login onto their systems if the group policy will not forced from command line.<\/p>\n<div id=\"attachment_24722\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Samba-Shared-Network-Volume-on-Windows.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24722\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Samba-Shared-Network-Volume-on-Windows.png\" sizes=\"auto, (max-width: 863px) 100vw, 863px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Samba-Shared-Network-Volume-on-Windows.png 863w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Samba-Shared-Network-Volume-on-Windows-768x489.png 768w\" alt=\"Samba Shared Network Volume on Windows\" width=\"863\" height=\"550\" aria-describedby=\"caption-attachment-24722\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24722\" class=\"wp-caption-text\">Samba Shared Network Volume on Windows<\/p>\n<\/div>\n<h3>Step 4: Access the Samba Shared Volume from Linux Clients<\/h3>\n<p><strong>13.<\/strong>\u00a0Linux users from machines that are enrolled into\u00a0<strong>Samba AD DC<\/strong>\u00a0can also access or mount the share locally by authenticating into the system with a Samba account.<\/p>\n<p>First, they need to assure that the following samba clients and utilities are installed on their systems by issuing the below command.<\/p>\n<pre>$ sudo apt-get install smbclient cifs-utils\r\n<\/pre>\n<p><strong>14.<\/strong>\u00a0In order to list the exported shares your domain provides for a specific domain controller machine use the below command:<\/p>\n<pre>$ smbclient \u2013L your_domain_controller \u2013U%\r\nor\r\n$ smbclient \u2013L \\adc1 \u2013U%\r\n<\/pre>\n<div id=\"attachment_24723\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/List-Samba-Share-Directory-in-Linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24723\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/List-Samba-Share-Directory-in-Linux.png\" alt=\"List Samba Share Directory in Linux\" width=\"751\" height=\"397\" aria-describedby=\"caption-attachment-24723\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24723\" class=\"wp-caption-text\">List Samba Share Directory in Linux<\/p>\n<\/div>\n<p><strong>15.<\/strong>\u00a0To interactively connect to a samba share from command line with a domain account use the following command:<\/p>\n<pre>$ sudo smbclient \/\/adc\/share_name -U domain_user\r\n<\/pre>\n<p>On command line you can list the content of the share, download or upload files to the share or perform other tasks. Use ? to list all available smbclient commands.<\/p>\n<div id=\"attachment_24725\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Connect-Samba-Share-Directory-in-Linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24725\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Connect-Samba-Share-Directory-in-Linux.png\" sizes=\"auto, (max-width: 860px) 100vw, 860px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Connect-Samba-Share-Directory-in-Linux.png 860w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Connect-Samba-Share-Directory-in-Linux-768x522.png 768w\" alt=\"Connect Samba Share Directory in Linux\" width=\"860\" height=\"584\" aria-describedby=\"caption-attachment-24725\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24725\" class=\"wp-caption-text\">Connect Samba Share Directory in Linux<\/p>\n<\/div>\n<p><strong>16.<\/strong>\u00a0To mount a samba share on a Linux machine use the below command.<\/p>\n<pre>$ sudo mount \/\/adc\/share_name \/mnt -o username=domain_user\r\n<\/pre>\n<div id=\"attachment_24726\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Mount-Samba-Share-Directory-in-Linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24726\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Mount-Samba-Share-Directory-in-Linux.png\" sizes=\"auto, (max-width: 1062px) 100vw, 1062px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Mount-Samba-Share-Directory-in-Linux.png 1062w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/02\/Mount-Samba-Share-Directory-in-Linux-768x226.png 768w\" alt=\"Mount Samba Share Directory in Linux\" width=\"1062\" height=\"312\" aria-describedby=\"caption-attachment-24726\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24726\" class=\"wp-caption-text\">Mount Samba Share Directory in Linux<\/p>\n<\/div>\n<p>Replace the\u00a0<strong>host<\/strong>,\u00a0<strong>share name<\/strong>,\u00a0<strong>mount point<\/strong>\u00a0and\u00a0<strong>domain user<\/strong>\u00a0accordingly. Use mount command piped with\u00a0<strong>grep<\/strong>to filter only by cifs expression.<\/p>\n<p>As some final conclusions, shares configured on a\u00a0<strong>Samba4 AD DC<\/strong>\u00a0will work only with Windows access control lists (<strong>ACL<\/strong>), not\u00a0<strong>POSIX ACLs<\/strong>.<\/p>\n<p>Configure Samba as a Domain member with file shares in order to achieve other capabilities for a network share. Also, on an Additional Domain Controller\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-active-directory-linux-command-line\/\" target=\"_blank\" rel=\"noopener\">configure Windbindd daemon<\/a>\u00a0\u2013\u00a0<strong>Step Two<\/strong>\u00a0\u2013 before you start exporting network shares.<\/p>\n<h1 class=\"post-title\">Integrate Ubuntu 16.04 to AD as a Domain Member with Samba and Winbind \u2013 Part 8<\/h1>\n<p>This tutorial describes how to join an Ubuntu machine into a\u00a0<strong>Samba4 Active Directory<\/strong>\u00a0domain in order to authenticate\u00a0<strong>AD<\/strong>\u00a0accounts with local\u00a0<strong>ACL<\/strong>\u00a0for files and directories or to create and map volume shares for domain controller users (act a as file server).<\/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 Active Directory Infrastructure with Samba4 on Ubuntu<\/a><\/li>\n<\/ol>\n<h3>Step 1: Initial Configurations to Join Ubuntu to Samba4 AD<\/h3>\n<p><strong>1.<\/strong>\u00a0Before starting to join an\u00a0<strong>Ubuntu<\/strong>\u00a0host into an\u00a0<strong>Active Directory DC<\/strong>\u00a0you need to assure that some services are configured properly on local machine.<\/p>\n<p>An important aspect of your machine represents the\u00a0<strong>hostname<\/strong>. Setup a proper machine name before joining the domain with the help of\u00a0<strong>hostnamectl<\/strong>\u00a0command or by manually editing\u00a0<strong>\/etc\/hostname<\/strong>\u00a0file.<\/p>\n<pre># hostnamectl set-hostname your_machine_short_name\r\n# cat \/etc\/hostname\r\n# hostnamectl\r\n<\/pre>\n<div id=\"attachment_24983\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Set-Ubuntu-System-Hostname.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24983\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Set-Ubuntu-System-Hostname.png\" alt=\"Set System Hostname\" width=\"591\" height=\"263\" aria-describedby=\"caption-attachment-24983\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24983\" class=\"wp-caption-text\">Set System Hostname<\/p>\n<\/div>\n<p><strong>2.<\/strong>\u00a0On the next step, open and manually edit your machine network settings with the proper IP configurations. The most important settings here are the DNS IP addresses which points back to your domain controller.<\/p>\n<p>Edit\u00a0<strong>\/etc\/network\/interfaces<\/strong>\u00a0file and add\u00a0<strong>dns-nameservers<\/strong>\u00a0statement with your proper AD IP addresses and domain name as illustrated on the below screenshot.<\/p>\n<p>Also, make sure that the same DNS IP addresses and the domain name are added to\u00a0<strong>\/etc\/resolv.conf<\/strong>\u00a0file.<\/p>\n<div id=\"attachment_24984\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Configure-Network-Settings-for-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24984\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Configure-Network-Settings-for-AD.png\" sizes=\"auto, (max-width: 867px) 100vw, 867px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Configure-Network-Settings-for-AD.png 867w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Configure-Network-Settings-for-AD-768x472.png 768w\" alt=\"Configure Network Settings for AD\" width=\"867\" height=\"533\" aria-describedby=\"caption-attachment-24984\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24984\" class=\"wp-caption-text\">Configure Network Settings for AD<\/p>\n<\/div>\n<p>On the above screenshot,\u00a0<strong>192.168.1.254<\/strong>\u00a0and\u00a0<strong>192.168.1.253<\/strong>\u00a0are the IP addresses of the\u00a0<strong>Samba4 AD DC<\/strong>\u00a0and\u00a0<strong>Tecmint.lan<\/strong>\u00a0represents the name of the AD domain which will be queried by all machines integrated into realm.<\/p>\n<p><strong>3.<\/strong>\u00a0Restart the network services or reboot the machine in order to apply the new network configurations. Issue a\u00a0<strong>ping<\/strong>\u00a0command against your domain name in order to test if DNS resolution is working as expected.<\/p>\n<p>The\u00a0<strong>AD DC<\/strong>\u00a0should replay with its FQDN. In case you have configured a DHCP server in your network to automatically assign IP settings for your LAN hosts, make sure you add AD DC IP addresses to the DHCP server DNS configurations.<\/p>\n<pre># systemctl restart networking.service\r\n# ping -c2 your_domain_name\r\n<\/pre>\n<p><strong>4.<\/strong>\u00a0The last important configuration required is represented by time synchronization. Install\u00a0<strong>ntpdate<\/strong>\u00a0package, query and sync time with the\u00a0<strong>AD DC<\/strong>\u00a0by issuing the below commands.<\/p>\n<pre>$ sudo apt-get install ntpdate\r\n$ sudo ntpdate -q your_domain_name\r\n$ sudo ntpdate your_domain_name\r\n<\/pre>\n<div id=\"attachment_24985\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Time-Synchronization-with-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24985\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Time-Synchronization-with-AD.png\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Time-Synchronization-with-AD.png 839w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Time-Synchronization-with-AD-768x303.png 768w\" alt=\"Time Synchronization with AD\" width=\"839\" height=\"331\" aria-describedby=\"caption-attachment-24985\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24985\" class=\"wp-caption-text\">Time Synchronization with AD<\/p>\n<\/div>\n<p><strong>5.<\/strong>\u00a0On the next step install the software required by Ubuntu machine to be fully integrated into the domain by running the below command.<\/p>\n<pre>$ sudo apt-get install samba krb5-config krb5-user winbind libpam-winbind libnss-winbind\r\n<\/pre>\n<div id=\"attachment_24986\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Install-Samba4-in-Ubuntu-Client.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24986\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Install-Samba4-in-Ubuntu-Client.png\" sizes=\"auto, (max-width: 1088px) 100vw, 1088px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Install-Samba4-in-Ubuntu-Client.png 1088w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Install-Samba4-in-Ubuntu-Client-768x299.png 768w\" alt=\"Install Samba4 in Ubuntu Client\" width=\"1088\" height=\"423\" aria-describedby=\"caption-attachment-24986\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24986\" class=\"wp-caption-text\">Install Samba4 in Ubuntu Client<\/p>\n<\/div>\n<p>While the Kerberos packages are installing you should be asked to enter the name of your default realm. Use the name of your domain with uppercases and press\u00a0<strong>Enter<\/strong>\u00a0key to continue the installation.<\/p>\n<div id=\"attachment_24987\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Add-AD-Domain-Name.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24987\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Add-AD-Domain-Name.png\" sizes=\"auto, (max-width: 1072px) 100vw, 1072px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Add-AD-Domain-Name.png 1072w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Add-AD-Domain-Name-768x181.png 768w\" alt=\"Add AD Domain Name\" width=\"1072\" height=\"252\" aria-describedby=\"caption-attachment-24987\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24987\" class=\"wp-caption-text\">Add AD Domain Name<\/p>\n<\/div>\n<p><strong>6.<\/strong>\u00a0After all packages finish installing, test\u00a0<strong>Kerberos<\/strong>\u00a0authentication against an AD administrative account and list the ticket by issuing the below commands.<\/p>\n<pre># kinit ad_admin_user\r\n# klist\r\n<\/pre>\n<div id=\"attachment_24988\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Check-Kerberos-Authentication-with-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24988\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Check-Kerberos-Authentication-with-AD.png\" alt=\"Check Kerberos Authentication with AD\" width=\"730\" height=\"271\" aria-describedby=\"caption-attachment-24988\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24988\" class=\"wp-caption-text\">Check Kerberos Authentication with AD<\/p>\n<\/div>\n<h3>Step 2: Join Ubuntu to Samba4 AD DC<\/h3>\n<p><strong>7.<\/strong>\u00a0The first step in integrating the Ubuntu machine into the\u00a0<strong>Samba4 Active Directory<\/strong>\u00a0domain is to edit\u00a0Samba configuration file.<\/p>\n<p>Backup the default configuration file of Samba, provided by the package manager, in order to start with a clean configuration by running the following commands.<\/p>\n<pre># mv \/etc\/samba\/smb.conf \/etc\/samba\/smb.conf.initial\r\n# nano \/etc\/samba\/smb.conf\u00a0\r\n<\/pre>\n<p>On the new Samba configuration file add the below lines:<\/p>\n<pre><strong>[global]<\/strong>\r\n        workgroup = TECMINT\r\n        realm = TECMINT.LAN\r\n        netbios name = ubuntu\r\n        security = ADS\r\n        dns forwarder = 192.168.1.1\r\n\r\nidmap config * : backend = tdb        \r\nidmap config *:range = 50000-1000000\r\n\t\r\n   template homedir = \/home\/%D\/%U\r\n   template shell = \/bin\/bash\r\n   winbind use default domain = true\r\n   winbind offline logon = false\r\n   winbind nss info = rfc2307\r\n   winbind enum users = yes\r\n   winbind enum groups = yes\r\n\r\n  vfs objects = acl_xattr\r\n  map acl inherit = Yes\r\n  store dos attributes = Yes\r\n<\/pre>\n<div id=\"attachment_24989\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Configure-Samba.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24989\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Configure-Samba.png\" alt=\"Configure Samba for AD\" width=\"602\" height=\"597\" aria-describedby=\"caption-attachment-24989\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24989\" class=\"wp-caption-text\">Configure Samba for AD<\/p>\n<\/div>\n<p>Replace\u00a0<strong>workgroup<\/strong>,\u00a0<strong>realm<\/strong>,\u00a0<strong>netbios name<\/strong>\u00a0and\u00a0<strong>dns forwarder<\/strong>\u00a0variables with your own custom settings.<\/p>\n<p>The\u00a0<strong>winbind use default domain<\/strong>\u00a0parameter causes\u00a0<strong>winbind<\/strong>\u00a0service to treat any unqualified AD usernames as users of the AD. You should omit this parameter if you have local system accounts names which overlap AD accounts.<\/p>\n<p><strong>8.<\/strong>\u00a0Now you should restart all samba daemons and stop and remove unnecessary services and enable samba services system-wide by issuing the below commands.<\/p>\n<pre>$ sudo systemctl restart smbd nmbd winbind\r\n$ sudo systemctl stop samba-ad-dc\r\n$ sudo systemctl enable smbd nmbd winbind\r\n<\/pre>\n<p><strong>9.<\/strong>\u00a0Join Ubuntu machine to\u00a0<strong>Samba4 AD DC<\/strong>\u00a0by issuing the following command. Use the name of an AD DC account with administrator privileges in order for the binding to realm to work as expected.<\/p>\n<pre>$ sudo net ads join -U ad_admin_user\r\n<\/pre>\n<div id=\"attachment_24990\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Join-Ubuntu-to-Samba4-AD-DC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24990\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Join-Ubuntu-to-Samba4-AD-DC.png\" alt=\"Join Ubuntu to Samba4 AD DC\" width=\"638\" height=\"234\" aria-describedby=\"caption-attachment-24990\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24990\" class=\"wp-caption-text\">Join Ubuntu to Samba4 AD DC<\/p>\n<\/div>\n<p><strong>10.<\/strong>\u00a0From a\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-ad-from-windows-via-rsat\/\" target=\"_blank\" rel=\"noopener\">Windows machine with RSAT tools installed<\/a>\u00a0you can open\u00a0<strong>AD UC<\/strong>\u00a0and navigate to\u00a0<strong>Computers<\/strong>container. Here, your Ubuntu joined machine should be listed.<\/p>\n<div id=\"attachment_24991\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Confirm-Ubuntu-Client-in-RSAT-.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24991\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Confirm-Ubuntu-Client-in-RSAT-.png\" sizes=\"auto, (max-width: 788px) 100vw, 788px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Confirm-Ubuntu-Client-in-RSAT-.png 788w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Confirm-Ubuntu-Client-in-RSAT--768x349.png 768w\" alt=\"Confirm Ubuntu Client in Windows AD DC\" width=\"788\" height=\"358\" aria-describedby=\"caption-attachment-24991\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24991\" class=\"wp-caption-text\">Confirm Ubuntu Client in Windows AD DC<\/p>\n<\/div>\n<h3>Step 3: Configure AD Accounts Authentication<\/h3>\n<p><strong>11.<\/strong>\u00a0In order to perform authentication for AD accounts on the local machine, you need to modify some services and files on the local machine.<\/p>\n<p>First, open and edit\u00a0<strong>The Name Service Switch<\/strong>\u00a0(<strong>NSS<\/strong>) configuration file.<\/p>\n<pre>$ sudo nano\u00a0\/etc\/nsswitch.conf\r\n<\/pre>\n<p>Next append winbind value for passwd and group lines as illustrated on the below excerpt.<\/p>\n<pre>passwd:         compat winbind\r\ngroup:          compat winbind\r\n<\/pre>\n<div id=\"attachment_24992\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Configure-AD-Accounts-Authentication.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24992\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Configure-AD-Accounts-Authentication.png\" alt=\"Configure AD Accounts Authentication\" width=\"689\" height=\"415\" aria-describedby=\"caption-attachment-24992\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24992\" class=\"wp-caption-text\">Configure AD Accounts Authentication<\/p>\n<\/div>\n<p><strong>12.<\/strong>\u00a0In order to test if the Ubuntu machine was successfully integrated to realm run\u00a0<strong>wbinfo<\/strong>\u00a0command to list domain accounts and groups.<\/p>\n<pre>$ wbinfo -u\r\n$ wbinfo -g\r\n<\/pre>\n<div id=\"attachment_24993\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/List-AD-Domain-Accounts-and-Groups.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24993\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/List-AD-Domain-Accounts-and-Groups.png\" alt=\"List AD Domain Accounts and Groups\" width=\"552\" height=\"545\" aria-describedby=\"caption-attachment-24993\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24993\" class=\"wp-caption-text\">List AD Domain Accounts and Groups<\/p>\n<\/div>\n<p><strong>13.<\/strong>\u00a0Also, check Winbind nsswitch module by issuing the\u00a0<strong>getent<\/strong>\u00a0command and pipe the results through a filter such as\u00a0<strong>grep<\/strong>\u00a0to narrow the output only for specific domain users or groups.<\/p>\n<pre>$ sudo getent passwd| grep your_domain_user\r\n$ sudo getent group|grep 'domain admins'\r\n<\/pre>\n<div id=\"attachment_24994\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Check-AD-Domain-Users-and-Groups.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24994\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Check-AD-Domain-Users-and-Groups.png\" alt=\"Check AD Domain Users and Groups\" width=\"751\" height=\"220\" aria-describedby=\"caption-attachment-24994\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24994\" class=\"wp-caption-text\">Check AD Domain Users and Groups<\/p>\n<\/div>\n<p><strong>14.<\/strong>\u00a0In order to authenticate on Ubuntu machine with domain accounts you need to run\u00a0<strong>pam-auth-update<\/strong>command with root privileges and add all the entries required for winbind service and to automatically create home directories for each domain account at the first login.<\/p>\n<p>Check all entries by pressing\u00a0<code>[space]<\/code>\u00a0key and hit\u00a0<strong>ok<\/strong>\u00a0to apply configuration.<\/p>\n<pre>$ sudo pam-auth-update\r\n<\/pre>\n<div id=\"attachment_24995\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Ubuntu-with-Domain-Accounts.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24995\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Ubuntu-with-Domain-Accounts.png\" sizes=\"auto, (max-width: 1006px) 100vw, 1006px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Ubuntu-with-Domain-Accounts.png 1006w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Ubuntu-with-Domain-Accounts-768x281.png 768w\" alt=\"Authenticate Ubuntu with Domain Accounts\" width=\"1006\" height=\"368\" aria-describedby=\"caption-attachment-24995\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24995\" class=\"wp-caption-text\">Authenticate Ubuntu with Domain Accounts<\/p>\n<\/div>\n<p><strong>15.<\/strong>\u00a0On Debian systems you need to manually edit\u00a0<strong>\/etc\/pam.d\/common-account<\/strong>\u00a0file and the following line in order to automatically create homes for authenticated domain users.<\/p>\n<pre>session    required    pam_mkhomedir.so    skel=\/etc\/skel\/    umask=0022\r\n<\/pre>\n<div id=\"attachment_24997\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Debian-with-Domain-Accounts.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24997\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Debian-with-Domain-Accounts.png\" sizes=\"auto, (max-width: 911px) 100vw, 911px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Debian-with-Domain-Accounts.png 911w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Debian-with-Domain-Accounts-768x502.png 768w\" alt=\"Authenticate Debian with Domain Accounts\" width=\"911\" height=\"595\" aria-describedby=\"caption-attachment-24997\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24997\" class=\"wp-caption-text\">Authenticate Debian with Domain Accounts<\/p>\n<\/div>\n<p><strong>16.<\/strong>\u00a0In order for\u00a0<strong>Active Directory<\/strong>\u00a0users to be able to change password from command line in Linux open\u00a0<strong>\/etc\/pam.d\/common-password<\/strong>\u00a0file and remove the\u00a0<strong>use_authtok<\/strong>\u00a0statement from password line to finally look as on the below excerpt.<\/p>\n<pre>password       [success=1 default=ignore]      pam_winbind.so try_first_pass\r\n<\/pre>\n<div id=\"attachment_24998\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/AD-Domain-Users-Change-Password.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24998\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/AD-Domain-Users-Change-Password.png\" sizes=\"auto, (max-width: 913px) 100vw, 913px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/AD-Domain-Users-Change-Password.png 913w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/AD-Domain-Users-Change-Password-768x476.png 768w\" alt=\"Users Allowed to Change Password\" width=\"913\" height=\"566\" aria-describedby=\"caption-attachment-24998\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24998\" class=\"wp-caption-text\">Users Allowed to Change Password<\/p>\n<\/div>\n<p><strong>17.<\/strong>\u00a0To authenticate on Ubuntu host with a Samba4 AD account use the domain username parameter after su \u2013 command. Run id command to get extra info about the AD account.<\/p>\n<pre>$ su - your_ad_user\r\n<\/pre>\n<div id=\"attachment_24999\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Find-AD-User-Information.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24999\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Find-AD-User-Information.png\" sizes=\"auto, (max-width: 893px) 100vw, 893px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Find-AD-User-Information.png 893w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Find-AD-User-Information-768x316.png 768w\" alt=\"Find AD User Information\" width=\"893\" height=\"367\" aria-describedby=\"caption-attachment-24999\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24999\" class=\"wp-caption-text\">Find AD User Information<\/p>\n<\/div>\n<p>Use\u00a0<a href=\"https:\/\/www.tecmint.com\/pwd-command-examples\/\" target=\"_blank\" rel=\"noopener\">pwd command<\/a>\u00a0to see your domain user current directory and passwd command if you want to change password.<\/p>\n<p><strong>18.<\/strong>\u00a0To use a domain account with root privileges on your Ubuntu machine, you need to add the AD username to the sudo system group by issuing the below command:<\/p>\n<pre>$ sudo usermod -aG sudo your_domain_user\r\n<\/pre>\n<p>Login to Ubuntu with the domain account and update your system by running\u00a0<strong>apt-get update<\/strong>\u00a0command to check if the domain user has root privileges.<\/p>\n<div id=\"attachment_25000\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Add-Sudo-User-Root-Group.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25000\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Add-Sudo-User-Root-Group.png\" alt=\"Add Sudo User Root Group\" width=\"739\" height=\"263\" aria-describedby=\"caption-attachment-25000\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25000\" class=\"wp-caption-text\">Add Sudo User Root Group<\/p>\n<\/div>\n<p><strong>19.<\/strong>\u00a0To add root privileges for a domain group, open end edit\u00a0<strong>\/etc\/sudoers<\/strong>\u00a0file using\u00a0<strong>visudo<\/strong>\u00a0command and add the following line as illustrated on the below screenshot.<\/p>\n<pre>%YOUR_DOMAIN\\your_domain\\  group       \t\t ALL=(ALL:ALL) ALL\r\n<\/pre>\n<div id=\"attachment_25001\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Add-Root-Privileges-to-Domain-Group.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25001\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Add-Root-Privileges-to-Domain-Group.jpg\" sizes=\"auto, (max-width: 812px) 100vw, 812px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Add-Root-Privileges-to-Domain-Group.jpg 812w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Add-Root-Privileges-to-Domain-Group-768x605.jpg 768w\" alt=\"Add Root Privileges to Domain Group\" width=\"812\" height=\"640\" aria-describedby=\"caption-attachment-25001\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25001\" class=\"wp-caption-text\">Add Root Privileges to Domain Group<\/p>\n<\/div>\n<p>Use backslashes to escape spaces contained into your domain group name or to escape the first backslash. In the above example the domain group for\u00a0<strong>TECMINT<\/strong>\u00a0realm is named \u201c<strong>domain admins<\/strong>\u201d.<\/p>\n<p>The preceding percent sign\u00a0<code>(%)<\/code>\u00a0symbol indicates that we are referring to a group, not a username.<\/p>\n<p><strong>20.<\/strong>\u00a0In case you are running the graphical version of Ubuntu and you want to login on the system with a domain user, you need to modify LightDM display manager by editing\u00a0<strong>\/usr\/share\/lightdm\/lightdm.conf.d\/50-ubuntu.conf<\/strong>\u00a0file, add the following lines and reboot the machine to reflect changes.<\/p>\n<pre>greeter-show-manual-login=true\r\ngreeter-hide-users=true\r\n<\/pre>\n<p>It should now be able to perform logins on Ubuntu Desktop with a domain account using either\u00a0<strong>your_domain_username<\/strong>\u00a0or\u00a0<strong>your_domain_username@your_domain.tld<\/strong>\u00a0or\u00a0<strong>your_domain\\your_domain_username<\/strong>format.<\/p>\n<h1 class=\"post-title\">Join CentOS 7 Desktop to Samba4 AD as a Domain Member \u2013 Part 9<\/h1>\n<p>This guide will describe how you can integrate\u00a0<strong>CentOS 7 Desktop<\/strong>\u00a0to\u00a0<strong>Samba4 Active Directory Domain Controller<\/strong>\u00a0with\u00a0<strong>Authconfig-gtk<\/strong>\u00a0in order to authenticate users across your network infrastructure from a single centralized account database held by\u00a0Samba.<\/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 Active Directory Infrastructure with Samba4 on Ubuntu<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/centos-7-3-installation-guide\/\" target=\"_blank\" rel=\"noopener\">CentOS 7.3 Installation Guide<\/a><\/li>\n<\/ol>\n<h3>Step 1: Configure CentOS Network for Samba4 AD DC<\/h3>\n<p><strong>1.<\/strong>\u00a0Before starting to join\u00a0<strong>CentOS 7 Desktop<\/strong>\u00a0to a\u00a0<strong>Samba4<\/strong>\u00a0domain you need to assure that the network is properly setup to query domain via DNS service.<\/p>\n<p>Open\u00a0<strong>Network Settings<\/strong>\u00a0and\u00a0<strong>turn off<\/strong>\u00a0the Wired network interface if enabled. Hit on the lower\u00a0<strong>Settings<\/strong>\u00a0button as illustrated in the below screenshots and manually edit your network settings, especially the\u00a0DNS\u00a0IPs that points to your\u00a0Samba4 AD DC.<\/p>\n<p>When you finish, Apply\u00a0the configurations and turn on your Network Wired Card.<\/p>\n<div id=\"attachment_25081\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Network-Settings.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25081\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Network-Settings.jpg\" sizes=\"auto, (max-width: 1191px) 100vw, 1191px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Network-Settings.jpg 1191w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Network-Settings-768x422.jpg 768w\" alt=\"Network Settings\" width=\"1191\" height=\"655\" aria-describedby=\"caption-attachment-25081\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25081\" class=\"wp-caption-text\">Network Settings<\/p>\n<\/div>\n<div id=\"attachment_25082\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Configure-Network.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25082\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Configure-Network.jpg\" sizes=\"auto, (max-width: 1047px) 100vw, 1047px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Configure-Network.jpg 1047w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Configure-Network-768x539.jpg 768w\" alt=\"Configure Network\" width=\"1047\" height=\"735\" aria-describedby=\"caption-attachment-25082\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25082\" class=\"wp-caption-text\">Configure Network<\/p>\n<\/div>\n<p><strong>2.<\/strong>\u00a0Next, open your network interface configuration file and add a line at the end of file with the name of your domain. This line assures that the domain counterpart is automatically appended by DNS resolution (FQDN) when you use only a short name for a domain DNS record.<\/p>\n<pre>$ sudo vi \/etc\/sysconfig\/network-scripts\/ifcfg-eno16777736\r\n<\/pre>\n<p>Add the following line:<\/p>\n<pre>SEARCH=\"your_domain_name\"\r\n<\/pre>\n<div id=\"attachment_25083\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Network-Interface-Configuration.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25083\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Network-Interface-Configuration.jpg\" sizes=\"auto, (max-width: 1136px) 100vw, 1136px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Network-Interface-Configuration.jpg 1136w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Network-Interface-Configuration-768x568.jpg 768w\" alt=\"Network Interface Configuration\" width=\"1136\" height=\"840\" aria-describedby=\"caption-attachment-25083\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25083\" class=\"wp-caption-text\">Network Interface Configuration<\/p>\n<\/div>\n<p><strong>3.<\/strong>\u00a0Finally, restart the network services to reflect changes, verify if the resolver configuration file is correctly configured and issue a series of\u00a0<strong>ping<\/strong>\u00a0commands against your DCs short names and against your domain name in order to verify if DNS resolution is working.<\/p>\n<pre>$ sudo systemctl restart network\r\n$ cat \/etc\/resolv.conf\r\n$ ping -c1 adc1\r\n$ ping -c1 adc2\r\n$ ping tecmint.lan\r\n<\/pre>\n<div id=\"attachment_25084\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Verify-Network-Configuration.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25084\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Verify-Network-Configuration.jpg\" sizes=\"auto, (max-width: 915px) 100vw, 915px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Verify-Network-Configuration.jpg 915w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Verify-Network-Configuration-768x705.jpg 768w\" alt=\"Verify Network Configuration\" width=\"915\" height=\"840\" aria-describedby=\"caption-attachment-25084\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25084\" class=\"wp-caption-text\">Verify Network Configuration<\/p>\n<\/div>\n<p><strong>4.<\/strong>\u00a0Also, configure your machine\u00a0hostname and reboot the machine to properly apply the settings by issuing the following commands:<\/p>\n<pre>$ sudo hostnamectl set-hostname your_hostname\r\n$ sudo init 6\r\n<\/pre>\n<p>Verify if hostname was correctly applied with the below commands:<\/p>\n<pre>$ cat \/etc\/hostname\r\n$ hostname\r\n<\/pre>\n<p><strong>5.<\/strong>\u00a0The last setting will ensure that your system time is in sync with\u00a0<strong>Samba4 AD DC<\/strong>\u00a0by issuing the below commands:<\/p>\n<pre>$ sudo yum install ntpdate\r\n$ sudo ntpdate -ud domain.tld\r\n<\/pre>\n<h3>Step 2: Install Required Software to Join Samba4 AD DC<\/h3>\n<p><strong>6.<\/strong>\u00a0In order to integrate CentOS 7 to an Active Directory domain install the following packages from command line:<\/p>\n<pre>$ sudo yum install samba samba samba-winbind krb5-workstation\r\n<\/pre>\n<p><strong>7.<\/strong>\u00a0Finally, install the graphical interface software used for domain integration provided by CentOS repos:\u00a0<strong>Authconfig-gtk<\/strong>.<\/p>\n<pre>$ sudo yum install authconfig-gtk\r\n<\/pre>\n<h3>Step 3: Join CentOS 7 Desktop to Samba4 AD DC<\/h3>\n<p><strong>8.<\/strong>\u00a0The process of joining CentOS to a domain controller is very straightforward. From command line open\u00a0<strong>Authconfig-gtk<\/strong>\u00a0program with root privileges and make the following changes as described below:<\/p>\n<pre>$ sudo authconfig-gtk\r\n<\/pre>\n<p>On\u00a0<strong>Identity &amp; Authentication<\/strong>\u00a0tab.<\/p>\n<ul>\n<li>User Account Database\u00a0= select\u00a0Winbind<\/li>\n<li>Winbind Domain\u00a0= YOUR_DOMAIN<\/li>\n<li>Security Model\u00a0= ADS<\/li>\n<li>Winbind ADS Realm\u00a0= YOUR_DOMAIN.TLD<\/li>\n<li>Domain Controllers\u00a0= domain machines FQDN<\/li>\n<li>Template Shell\u00a0= \/bin\/bash<\/li>\n<li>Allow offline login\u00a0=\u00a0checked<\/li>\n<\/ul>\n<div id=\"attachment_25085\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authentication-Configuration.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25085\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authentication-Configuration.jpg\" sizes=\"auto, (max-width: 1461px) 100vw, 1461px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authentication-Configuration.jpg 1461w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authentication-Configuration-768x492.jpg 768w\" alt=\"Authentication Configuration\" width=\"1461\" height=\"936\" aria-describedby=\"caption-attachment-25085\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25085\" class=\"wp-caption-text\">Authentication Configuration<\/p>\n<\/div>\n<p>On\u00a0<strong>Advanced Options<\/strong>\u00a0tab.<\/p>\n<ul>\n<li>Local Authentication Options\u00a0= check\u00a0Enable fingerprint reader support<\/li>\n<li>Other Authentication Options\u00a0= check\u00a0Create home directories on the first login<\/li>\n<\/ul>\n<div id=\"attachment_25086\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authentication-Advance-Configuration.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25086\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authentication-Advance-Configuration.jpg\" alt=\"Authentication Advance Configuration\" width=\"691\" height=\"900\" aria-describedby=\"caption-attachment-25086\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25086\" class=\"wp-caption-text\">Authentication Advance Configuration<\/p>\n<\/div>\n<p><strong>9.<\/strong>\u00a0After you\u2019ve added all required values, return to\u00a0Identity &amp; Authentication\u00a0tab and hit on\u00a0<strong>Join Domain<\/strong>\u00a0button and\u00a0the\u00a0<strong>Save<\/strong>\u00a0button from alert window\u00a0to save settings.<\/p>\n<div id=\"attachment_25087\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Identity-and-Authentication.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25087\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Identity-and-Authentication.jpg\" alt=\"Identity and Authentication\" width=\"648\" height=\"877\" aria-describedby=\"caption-attachment-25087\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25087\" class=\"wp-caption-text\">Identity and Authentication<\/p>\n<\/div>\n<div id=\"attachment_25088\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Save-Authentication-Configuration.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25088\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Save-Authentication-Configuration.jpg\" alt=\"Save Authentication Configuration\" width=\"683\" height=\"889\" aria-describedby=\"caption-attachment-25088\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25088\" class=\"wp-caption-text\">Save Authentication Configuration<\/p>\n<\/div>\n<p><strong>10.<\/strong>\u00a0After the configuration has been saved you will be asked to provide a domain administrator account in order to join the domain. Supply the credentials for a domain administrator user and hit OK button to finally join the domain.<\/p>\n<div id=\"attachment_25089\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Joining-Winbind-Domain.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25089\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Joining-Winbind-Domain.jpg\" alt=\"Joining Winbind Domain\" width=\"645\" height=\"881\" aria-describedby=\"caption-attachment-25089\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25089\" class=\"wp-caption-text\">Joining Winbind Domain<\/p>\n<\/div>\n<p><strong>11.<\/strong>\u00a0After your machine has been integrated into the realm, hit on\u00a0<strong>Apply<\/strong>\u00a0button to reflect changes, close all windows and reboot the machine.<\/p>\n<div id=\"attachment_25091\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Apply-Authentication-Configuration.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25091\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Apply-Authentication-Configuration.jpg\" alt=\"Apply Authentication Configuration\" width=\"684\" height=\"883\" aria-describedby=\"caption-attachment-25091\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25091\" class=\"wp-caption-text\">Apply Authentication Configuration<\/p>\n<\/div>\n<p><strong>12.<\/strong>\u00a0In order to verify if the system has been joined to\u00a0<strong>Samba4 AD DC<\/strong>\u00a0open AD Users and Computers\u00a0from a Windows machine with\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-ad-from-windows-via-rsat\/\" target=\"_blank\" rel=\"noopener\">RSAT tools installed<\/a>\u00a0and navigate to your domain Computers container.<\/p>\n<p>The name of your CentOS machine should be listed on the right plane.<\/p>\n<div id=\"attachment_25092\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Active-Directory-Users-and-Computers.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25092\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Active-Directory-Users-and-Computers.jpg\" sizes=\"auto, (max-width: 1107px) 100vw, 1107px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Active-Directory-Users-and-Computers.jpg 1107w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Active-Directory-Users-and-Computers-768x407.jpg 768w\" alt=\"Active Directory Users and Computers\" width=\"1107\" height=\"587\" aria-describedby=\"caption-attachment-25092\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25092\" class=\"wp-caption-text\">Active Directory Users and Computers<\/p>\n<\/div>\n<h3>Step 4: Login to CentOS Desktop with a Samba4 AD DC Account<\/h3>\n<p><strong>13.<\/strong>\u00a0In order to login to CentOS Desktop hit on\u00a0Not listed?\u00a0link and add the username of a domain account preceded by the domain counterpart as illustrated below.<\/p>\n<pre>Domain\\domain_account\r\nor\r\nDomain_user@domain.tld\r\n<\/pre>\n<div id=\"attachment_25094\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Not-listed-Users.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25094\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Not-listed-Users.jpg\" sizes=\"auto, (max-width: 1292px) 100vw, 1292px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Not-listed-Users.jpg 1292w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Not-listed-Users-768x418.jpg 768w\" alt=\"Not listed Users\" width=\"1292\" height=\"703\" aria-describedby=\"caption-attachment-25094\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25094\" class=\"wp-caption-text\">Not listed Users<\/p>\n<\/div>\n<div id=\"attachment_25093\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Enter-Domain-Username.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25093\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Enter-Domain-Username.jpg\" sizes=\"auto, (max-width: 1167px) 100vw, 1167px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Enter-Domain-Username.jpg 1167w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Enter-Domain-Username-768x461.jpg 768w\" alt=\"Enter Domain Username\" width=\"1167\" height=\"700\" aria-describedby=\"caption-attachment-25093\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25093\" class=\"wp-caption-text\">Enter Domain Username<\/p>\n<\/div>\n<p><strong>14.<\/strong>\u00a0To authenticate with a domain account from command line in CentOS use one of the following syntaxes:<\/p>\n<pre>$ su - domain\\domain_user\r\n$ su - domain_user@domain.tld\r\n<\/pre>\n<div id=\"attachment_25096\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Domain-User.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25096\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Domain-User.jpg\" sizes=\"auto, (max-width: 957px) 100vw, 957px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Domain-User.jpg 957w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Domain-User-768x418.jpg 768w\" alt=\"Authenticate Domain Username\" width=\"957\" height=\"521\" aria-describedby=\"caption-attachment-25096\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25096\" class=\"wp-caption-text\">Authenticate Domain Username<\/p>\n<\/div>\n<div id=\"attachment_25095\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Domain-User-Email.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25095\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Domain-User-Email.jpg\" sizes=\"auto, (max-width: 993px) 100vw, 993px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Domain-User-Email.jpg 993w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Authenticate-Domain-User-Email-768x374.jpg 768w\" alt=\"Authenticate Domain User Email\" width=\"993\" height=\"484\" aria-describedby=\"caption-attachment-25095\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25095\" class=\"wp-caption-text\">Authenticate Domain User Email<\/p>\n<\/div>\n<p><strong>15.<\/strong>\u00a0To add root privileges for a domain user or group, edit sudoers file using visudo command with root powers and add the following lines as illustrated on the below excerpt:<\/p>\n<pre>YOUR_DOMAIN\\domain_username       \t\t ALL=(ALL:ALL) ALL  \t#For domain users\r\n%YOUR_DOMAIN\\your_domain\\  group      \t\t ALL=(ALL:ALL) ALL\t#For domain groups\r\n<\/pre>\n<div id=\"attachment_25097\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Assign-Permission-to-User-and-Group.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25097\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Assign-Permission-to-User-and-Group.jpg\" sizes=\"auto, (max-width: 1365px) 100vw, 1365px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Assign-Permission-to-User-and-Group.jpg 1365w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Assign-Permission-to-User-and-Group-768x432.jpg 768w\" alt=\"Assign Permission to User and Group\" width=\"1365\" height=\"768\" aria-describedby=\"caption-attachment-25097\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25097\" class=\"wp-caption-text\">Assign Permission to User and Group<\/p>\n<\/div>\n<p><strong>16.<\/strong>\u00a0To display a summary about the domain controller use the following command:<\/p>\n<pre>$ sudo net ads info\r\n<\/pre>\n<div id=\"attachment_25098\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Check-Domain-Controller-Info.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25098\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Check-Domain-Controller-Info.jpg\" sizes=\"auto, (max-width: 1016px) 100vw, 1016px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Check-Domain-Controller-Info.jpg 1016w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Check-Domain-Controller-Info-768x348.jpg 768w\" alt=\"Check Domain Controller Info\" width=\"1016\" height=\"460\" aria-describedby=\"caption-attachment-25098\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25098\" class=\"wp-caption-text\">Check Domain Controller Info<\/p>\n<\/div>\n<p><strong>17.<\/strong>\u00a0In order to verify if the trust machine account created when CentOS was added to the Samba4 AD DC is functional and list domain accounts from command line install Winbind client by issuing the below command:<\/p>\n<pre>$ sudo yum install samba-winbind-clients\r\n<\/pre>\n<p>Then issue a series of checks against Samba4 AD DC by executing the following commands:<\/p>\n<pre>$ wbinfo -p #Ping domain\r\n$ wbinfo -t #Check trust relationship\r\n$ wbinfo -u #List domain users\r\n$ wbinfo -g #List domain groups\r\n$ wbinfo -n domain_account #Get the SID of a domain account\r\n<\/pre>\n<div id=\"attachment_25099\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Get-Samba4-AD-DC-Details.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25099\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Get-Samba4-AD-DC-Details.jpg\" sizes=\"auto, (max-width: 871px) 100vw, 871px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Get-Samba4-AD-DC-Details.jpg 871w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Get-Samba4-AD-DC-Details-768x703.jpg 768w\" alt=\"Get Samba4 AD DC Details\" width=\"871\" height=\"797\" aria-describedby=\"caption-attachment-25099\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25099\" class=\"wp-caption-text\">Get Samba4 AD DC Details<\/p>\n<\/div>\n<p><strong>18.<\/strong>\u00a0In case you want to leave the domain issue the following command against your domain name by using an domain account with administrator privileges:<\/p>\n<pre>$ sudo net ads leave your_domain -U domain_admin_username\r\n<\/pre>\n<div id=\"attachment_25100\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Leave-Domain-from-Samba4-AD.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25100\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Leave-Domain-from-Samba4-AD.jpg\" sizes=\"auto, (max-width: 1004px) 100vw, 1004px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Leave-Domain-from-Samba4-AD.jpg 1004w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Leave-Domain-from-Samba4-AD-768x348.jpg 768w\" alt=\"Leave Domain from Samba4 AD\" width=\"1004\" height=\"455\" aria-describedby=\"caption-attachment-25100\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25100\" class=\"wp-caption-text\">Leave Domain from Samba4 AD<\/p>\n<\/div>\n<p>That\u2019s all! Although this procedure is focused on joining\u00a0<strong>CentOS 7<\/strong>\u00a0to a\u00a0<strong>Samba4 AD DC<\/strong>, the same steps described in this documentation are also valid for integrating a CentOS 7 Desktop machine to a Microsoft Windows Server 2008 or 2012 domain.<\/p>\n<h1 class=\"post-title\">How to Install iRedMail on CentOS 7 for Samba4 AD Integration \u2013 Part 10<\/h1>\n<p>This series of tutorials will guide you on how to integrate\u00a0<strong>iRedMail<\/strong>\u00a0installed on a\u00a0<strong>CentOS 7<\/strong>\u00a0machine with a\u00a0<a href=\"https:\/\/www.tecmint.com\/install-samba4-active-directory-ubuntu\/\" target=\"_blank\" rel=\"noopener\">Samba4 Active Directory Domain Controller<\/a>\u00a0in order for domain accounts to send or receive mail via Thunderbird desktop client or via Roundcube web interface.<\/p>\n<p>The\u00a0<strong>CentOS 7<\/strong>\u00a0server where iRedMail will be installed will allow SMTP or mail routing services via ports 25 and 587 and will also serve as a mail delivery agent through Dovecot, providing POP3 and IMAP services, both secured with self-signed certificates issued on the installation process.<\/p>\n<p>The recipient mailboxes will be stored on the same CentOS server along with the webmail user agent provided by Roundcube. Samba4 Active Directory will be used by iRedMail to query and authenticate recipient accounts against the realm, to create mail lists with the help of Active Directory groups and to control the mail accounts via Samba4 AD DC.<\/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 Active Directory Infrastructure with Samba4 on Ubuntu<\/a><\/li>\n<\/ol>\n<h3>Step 1: Install iRedMail in CentOS 7<\/h3>\n<p><strong>1.<\/strong>\u00a0Before starting with iRedMail installation first make sure you have a fresh CentOS 7 operating system installed on your machine using the instructions provided by this guide:<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/centos-7-3-installation-guide\/\" target=\"_blank\" rel=\"noopener\">Fresh Installation of CentOS 7 Minimal<\/a><\/li>\n<\/ol>\n<p><strong>2.<\/strong>\u00a0Also, assure that the system is up-to-date with the latest security and packages updates by issuing the below command.<\/p>\n<pre># yum update\r\n<\/pre>\n<p><strong>3.<\/strong>\u00a0The system will also need a FQDN hostname set by issuing the below command. Replace\u00a0<code>mail.tecmint.lan<\/code>\u00a0variable with your own custom FQDN.<\/p>\n<pre># hostnamectl set-hostname <strong>mail.tecmint.lan<\/strong>\r\n<\/pre>\n<p>Verify system hostname with the below commands.<\/p>\n<pre># hostname -s   # Short name\r\n# hostname -f   # FQDN\r\n# hostname -d   # Domain\r\n# cat \/etc\/hostname  # Verify it with cat command\r\n<\/pre>\n<div id=\"attachment_25181\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Verify-CentOS-7-Hostname.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25181\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/Verify-CentOS-7-Hostname.png\" alt=\"Verify CentOS 7 Hostname\" width=\"567\" height=\"250\" aria-describedby=\"caption-attachment-25181\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25181\" class=\"wp-caption-text\">Verify CentOS 7 Hostname<\/p>\n<\/div>\n<p><strong>4.<\/strong>\u00a0Map the machine FQDN and short name against the machine loopback IP address by manually editing\u00a0<code>\/etc\/hosts<\/code>\u00a0file. Add the values as illustrated below and replace\u00a0<code>mail.tecmint.lan<\/code>\u00a0and mail values accordingly.<\/p>\n<pre>127.0.0.1   <strong>mail.tecmint.lan mail<\/strong>  localhost localhost.localdomain\r\n<\/pre>\n<p><strong>5.<\/strong>\u00a0iRedMail technicians recommends that SELinux should be completely disabled. Disable SELinux by editing\u00a0<strong>\/etc\/selinux\/config<\/strong>\u00a0file and set SELINUX parameter from\u00a0<code>permissive<\/code>\u00a0to\u00a0<code>disabled<\/code>\u00a0as illustrated below.<\/p>\n<pre>SELINUX=disabled\r\n<\/pre>\n<p>Reboot the machine to apply new SELinux policies or run setenforce with 0 parameter to force SELinux to instantly disable.<\/p>\n<pre># reboot\r\nOR\r\n# setenforce 0\r\n<\/pre>\n<p><strong>6.<\/strong>\u00a0Next, install the following packages that will come in-handy later for system administration:<\/p>\n<pre># yum install bzip2 net-tools bash-completion wget\r\n<\/pre>\n<p><strong>7.<\/strong>\u00a0In order to install iRedMail, first go to the download page\u00a0<a href=\"http:\/\/www.iredmail.org\/download.html\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/www.iredmail.org\/download.html<\/a>\u00a0and grab the latest archive version of the software by issuing the below command.<\/p>\n<pre># wget https:\/\/bitbucket.org\/zhb\/iredmail\/downloads\/iRedMail-0.9.6.tar.bz2\r\n<\/pre>\n<p><strong>8.<\/strong>\u00a0After the download finishes, extract the compressed archive and enter the extracted iRedMail directory by issuing the following commands.<\/p>\n<pre># tar xjf iRedMail-0.9.6.tar.bz2 \r\n# cd iRedMail-0.9.6\/\r\n# ls\r\n<\/pre>\n<p><strong>9.<\/strong>\u00a0Start the installation process by executing iRedMail shell script with the following command. From now on a series of questions will be asked by the installer.<\/p>\n<pre># bash iRedMail.sh\r\n<\/pre>\n<p><strong>10.<\/strong>\u00a0On the first welcome prompt hit on\u00a0<code>Yes<\/code>\u00a0to proceed further with the installation.<\/p>\n<div id=\"attachment_25182\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Setup-Wizard.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25182\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Setup-Wizard.png\" alt=\"iRedMail Setup Wizard\" width=\"708\" height=\"490\" aria-describedby=\"caption-attachment-25182\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25182\" class=\"wp-caption-text\">iRedMail Setup Wizard<\/p>\n<\/div>\n<p><strong>11.<\/strong>\u00a0Next, choose the location where all the mail will be stored. The default directory that iRedMail uses to store mailboxes is\u00a0<code>\/var\/vmail\/<\/code>\u00a0system path.<\/p>\n<p>If this directory is located under a partition with enough storage to host mail for all your domain accounts then hit on\u00a0<strong>Next<\/strong>\u00a0to continue.<\/p>\n<p>Otherwise change the default location with a different directory in case if you\u2019ve configured a larger partition dedicated to mail storage.<\/p>\n<div id=\"attachment_25183\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Mail-Storage-Path.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25183\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Mail-Storage-Path.png\" alt=\"iRedMail Mail Storage Path\" width=\"723\" height=\"454\" aria-describedby=\"caption-attachment-25183\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25183\" class=\"wp-caption-text\">iRedMail Mail Storage Path<\/p>\n<\/div>\n<p><strong>12.<\/strong>\u00a0On the next step choose the frontend web server through which you will interact with iRedMail. iRedMail administration panel will be completely disabled later, so we will use the frontend web server only to access accounts mail via Roundcube web panel.<\/p>\n<p>If you don\u2019t have thousands of mail accounts per hour accessing the webmail interface you should go with Apache web server do to its flexibility and easy management.<\/p>\n<div id=\"attachment_25184\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Preferred-Web-Server.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25184\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Preferred-Web-Server.png\" alt=\"iRedMail Preferred Web Server\" width=\"726\" height=\"470\" aria-describedby=\"caption-attachment-25184\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25184\" class=\"wp-caption-text\">iRedMail Preferred Web Server<\/p>\n<\/div>\n<p><strong>13.<\/strong>\u00a0On this step choose OpenLDAP backend database for compatibility reasons with Samba4 domain controller and hit\u00a0<strong>Next<\/strong>\u00a0to continue, although we won\u2019t use this OpenLDAP database later once we\u2019ll integrate iRedMail to Samba domain controller.<\/p>\n<div id=\"attachment_25185\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-LDAP-Backend.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25185\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-LDAP-Backend.png\" alt=\"iRedMail LDAP Backend\" width=\"726\" height=\"474\" aria-describedby=\"caption-attachment-25185\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25185\" class=\"wp-caption-text\">iRedMail LDAP Backend<\/p>\n<\/div>\n<p><strong>14.<\/strong>\u00a0Next, specify your Samba4 domain name for LDAP suffix as illustrated on the image below and hit\u00a0<strong>Next<\/strong>\u00a0to continue.<\/p>\n<div id=\"attachment_25186\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-LDAP-Suffix.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25186\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-LDAP-Suffix.png\" alt=\"iRedMail LDAP Suffix\" width=\"734\" height=\"467\" aria-describedby=\"caption-attachment-25186\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25186\" class=\"wp-caption-text\">iRedMail LDAP Suffix<\/p>\n<\/div>\n<p><strong>15.<\/strong>\u00a0On the next prompt enter your domain name only and hit\u00a0<strong>Next<\/strong>\u00a0to move on. Replace\u00a0<code>tecmint.lan<\/code>\u00a0value accordingly.<\/p>\n<div id=\"attachment_25187\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Mail-Domain.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25187\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Mail-Domain.png\" alt=\"iRedMail Mail Domain\" width=\"732\" height=\"502\" aria-describedby=\"caption-attachment-25187\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25187\" class=\"wp-caption-text\">iRedMail Mail Domain<\/p>\n<\/div>\n<p><strong>16.<\/strong>\u00a0Now, setup a password for\u00a0<code>postmaster@yourdomain.tld<\/code>\u00a0administrator and hit\u00a0<strong>Next<\/strong>\u00a0to continue.<\/p>\n<div id=\"attachment_25188\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Mail-Domain-Administrator.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25188\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Mail-Domain-Administrator.png\" alt=\"iRedMail Mail Domain Administrator\" width=\"729\" height=\"464\" aria-describedby=\"caption-attachment-25188\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25188\" class=\"wp-caption-text\">iRedMail Mail Domain Administrator<\/p>\n<\/div>\n<p><strong>17.<\/strong>\u00a0Next, choose from the list the optional components you want to integrate with your mail server. I strongly recommend to install Roundcube in order to provide a web interface for domain accounts to access mail, although Roundcube can be installed and configured on a different machine for this task in order to free mail server resources in case of high loads.<\/p>\n<p>For local domains with restricted internet access and especially while we\u2019re using domain integration the other components are not very useful, except Awstats in case you need mail analysis.<\/p>\n<div id=\"attachment_25189\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Optional-Components.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25189\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Optional-Components.png\" alt=\"iRedMail Optional Components\" width=\"728\" height=\"489\" aria-describedby=\"caption-attachment-25189\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25189\" class=\"wp-caption-text\">iRedMail Optional Components<\/p>\n<\/div>\n<p><strong>18.<\/strong>\u00a0On the next review screen type\u00a0<code>Y<\/code>\u00a0in order to apply configuration and start the installation process.<\/p>\n<div id=\"attachment_25190\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Configuration-Changes.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25190\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Configuration-Changes.png\" alt=\"iRedMail Configuration Changes\" width=\"731\" height=\"367\" aria-describedby=\"caption-attachment-25190\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25190\" class=\"wp-caption-text\">iRedMail Configuration Changes<\/p>\n<\/div>\n<p><strong>19.<\/strong>\u00a0Finally, accept iRedMail scripts to automatically configure your machine firewall and MySQL configuration file by typing yes for all questions.<\/p>\n<div id=\"attachment_25191\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-System-Configuration.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25191\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-System-Configuration.png\" alt=\"iRedMail System Configuration\" width=\"727\" height=\"548\" aria-describedby=\"caption-attachment-25191\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25191\" class=\"wp-caption-text\">iRedMail System Configuration<\/p>\n<\/div>\n<p><strong>20.<\/strong>\u00a0After the installation finishes the installer will provide some sensitive information, such as iRedAdmin credentials, web panel URL addresses and the file location with all parameters used at the installation process.<\/p>\n<div id=\"attachment_25192\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Installation-Summary.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25192\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Installation-Summary.png\" alt=\"iRedMail Installation Summary\" width=\"748\" height=\"883\" aria-describedby=\"caption-attachment-25192\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25192\" class=\"wp-caption-text\">iRedMail Installation Summary<\/p>\n<\/div>\n<p>Read the displayed information above carefully and reboot the machine in order to enable all mail services by issuing the following command.<\/p>\n<pre># init 6\r\n<\/pre>\n<p><strong>21.<\/strong>\u00a0After the system reboots, login with an account with root privileges or as root and list all network sockets and their associated programs your mail server listens on by issuing the following command.<\/p>\n<p>From the socket list you will see that your mail server covers almost all services required by a mail server to properly function: SMTP\/S, POP3\/S, IMAP\/S and antivirus along with spam protection.<\/p>\n<pre># netstat -tulpn\r\n<\/pre>\n<div id=\"attachment_25193\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Network-Sockets.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25193\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Network-Sockets.png\" sizes=\"auto, (max-width: 874px) 100vw, 874px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Network-Sockets.png 874w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Network-Sockets-768x526.png 768w\" alt=\"iRedMail Network Sockets\" width=\"874\" height=\"599\" aria-describedby=\"caption-attachment-25193\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25193\" class=\"wp-caption-text\">iRedMail Network Sockets<\/p>\n<\/div>\n<p><strong>22.<\/strong>\u00a0In order to view the location of all configuration files iRedMail has modified and the credentials used by iRedMail during the installation process for database administration, mail admin account and other accounts, display the contents of\u00a0<strong>iRedMail.tips<\/strong>\u00a0file.<\/p>\n<p>The file is located in the directory where you\u2019ve initially extracted the installation archive. Be aware that you should move and protect this file because it contains sensitive information about your mail server.<\/p>\n<pre># less iRedMail-0.9.6\/iRedMail.tips\r\n<\/pre>\n<p><strong>23.<\/strong>\u00a0The file mentioned above which contain details about your mail server will also be automatically mailed to the mail server administrator account, represented by the postmaster account.<\/p>\n<p>The webmail can be accessed securely via HTTPS protocol by typing your machine IP address in a browser. Accept the error generated in browser by the iRedMail self-signed web certificate and log in with the password chosen for\u00a0<strong>postmaster@your_domain.tld<\/strong>\u00a0account during the initial installation. Read and store this e-mail to a safe mailbox.<\/p>\n<pre>https:\/\/192.168.1.254\r\n<\/pre>\n<div id=\"attachment_25194\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Account-Login.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25194\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Account-Login.png\" sizes=\"auto, (max-width: 1251px) 100vw, 1251px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Account-Login.png 1251w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Account-Login-768x423.png 768w\" alt=\"iRedMail Account Login\" width=\"1251\" height=\"689\" aria-describedby=\"caption-attachment-25194\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25194\" class=\"wp-caption-text\">iRedMail Account Login<\/p>\n<\/div>\n<div id=\"attachment_25195\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Web-Mail.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25195\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Web-Mail.png\" sizes=\"auto, (max-width: 1248px) 100vw, 1248px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Web-Mail.png 1248w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/03\/iRedMail-Web-Mail-768x422.png 768w\" alt=\"iRedMail Web Mail\" width=\"1248\" height=\"685\" aria-describedby=\"caption-attachment-25195\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25195\" class=\"wp-caption-text\">iRedMail Web Mail<\/p>\n<\/div>\n<p>That\u2019s all! By now, you\u2019ll have a full mail server configured on your premises which operates on its own, but not yet integrated with Samba4 Active Directory Domain Controller services.<\/p>\n<p>On the next part we will see how to tamper iRedMail services (postfix, dovecot and roundcube configuration files) in order to query domain accounts, send, receive and read mail.<\/p>\n<h1 class=\"post-title\">How to Configure and Integrate iRedMail Services to Samba4 AD DC \u2013 Part 11<\/h1>\n<p>In this tutorial will learn how to modify iRedMail main daemons which provide mail services, respectively,\u00a0<a href=\"https:\/\/www.tecmint.com\/setup-postfix-mail-server-and-dovecot-with-mariadb-in-centos\/\" target=\"_blank\" rel=\"noopener noreferrer\">Postfix used for mail transfer and Dovecot<\/a>\u00a0which delivers mail to accounts mailboxes, in order to integrate them both in\u00a0<a href=\"https:\/\/www.tecmint.com\/install-samba4-active-directory-ubuntu\/\" target=\"_blank\" rel=\"noopener noreferrer\">Samba4 Active Directory Domain Controller<\/a>.<\/p>\n<p>By integrating iRedMail to a Samba4 AD DC you will benefit from the following features: user authentication, management, and status via Samba AD DC, create mail lists with the help of AD groups and Global LDAP Address Book in Roundcube.<\/p>\n<h4>Requirements<\/h4>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/install-iredmail-on-centos-7-for-samba4-ad-integration\/\" target=\"_blank\" rel=\"noopener noreferrer\">Install iRedMail on CentOS 7 for Samba4 AD Integration<\/a><\/li>\n<\/ol>\n<h3>Step 1: Prepare iRedMail System for Sama4 AD Integration<\/h3>\n<p><strong>1.<\/strong>\u00a0On the first step, you need to\u00a0<a href=\"https:\/\/www.tecmint.com\/set-add-static-ip-address-in-linux\/\" target=\"_blank\" rel=\"noopener noreferrer\">assign a static IP address for your machine<\/a>\u00a0in case you\u2019re using a dynamic IP address provided by a DHCP server.<\/p>\n<p>Run\u00a0<a href=\"https:\/\/www.tecmint.com\/ifconfig-command-examples\/\" target=\"_blank\" rel=\"noopener noreferrer\">ifconfig command<\/a>\u00a0to list your machine network interfaces names and edit the proper network interface with your custom IP settings by issuing\u00a0<a href=\"https:\/\/www.tecmint.com\/configure-network-connections-using-nmcli-tool-in-linux\/\" target=\"_blank\" rel=\"noopener noreferrer\">nmtui-edit<\/a>\u00a0command against the correct NIC.<\/p>\n<p>Run\u00a0<strong>nmtui-edit<\/strong>\u00a0command with root privileges.<\/p>\n<pre># ifconfig\r\n# nmtui-edit eno16777736\r\n<\/pre>\n<div id=\"attachment_25586\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Find-Network-Interface-Name.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25586\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Find-Network-Interface-Name.png\" alt=\"Find Network Interface Name\" width=\"626\" height=\"324\" aria-describedby=\"caption-attachment-25586\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25586\" class=\"wp-caption-text\">Find Network Interface Name<\/p>\n<\/div>\n<p><strong>2.<\/strong>\u00a0Once the network interface is opened for editing, add the proper static IP settings, make sure you add the DNS servers IP addresses of your Samba4 AD DC and the name of your domain in order to query the realm from your machine. Use the below screenshot as a guide.<\/p>\n<div id=\"attachment_25587\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Configure-Network-Settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25587\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Configure-Network-Settings.png\" alt=\"Configure Network Settings\" width=\"603\" height=\"535\" aria-describedby=\"caption-attachment-25587\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25587\" class=\"wp-caption-text\">Configure Network Settings<\/p>\n<\/div>\n<p><strong>3.<\/strong>\u00a0After you finish configuring the network interface, restart the network daemon to apply changes and issue a series of ping commands against the domain name and samba4 domain controllers FQDNs.<\/p>\n<pre># systemctl restart network.service\r\n# cat \/etc\/resolv.conf     # verify DNS resolver configuration if the correct DNS servers IPs are queried for domain resolution\r\n# ping -c2 tecmint.lan     # Ping domain name\r\n# ping -c2 adc1            # Ping first AD DC\r\n# ping -c2 adc2            # Ping second AD DC\r\n<\/pre>\n<div id=\"attachment_25588\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Verify-Network-DNS-Configuration.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25588\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Verify-Network-DNS-Configuration.png\" alt=\"Verify Network DNS Configuration\" width=\"650\" height=\"521\" aria-describedby=\"caption-attachment-25588\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25588\" class=\"wp-caption-text\">Verify Network DNS Configuration<\/p>\n<\/div>\n<p><strong>4.<\/strong>\u00a0Next, sync time with samba domain controller by installing the\u00a0<strong>ntpdate<\/strong>\u00a0package and query Samba4 machine NTP server by issuing the below commands:<\/p>\n<pre># yum install ntpdate\r\n# ntpdate -qu tecmint.lan      # querry domain NTP servers\r\n# ntpdate tecmint.lan          # Sync time with the domain\r\n<\/pre>\n<div id=\"attachment_25589\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Sync-Time-with-Samba-NTP-Server.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25589\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Sync-Time-with-Samba-NTP-Server.png\" alt=\"Sync Time with Samba NTP Server\" width=\"696\" height=\"219\" aria-describedby=\"caption-attachment-25589\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25589\" class=\"wp-caption-text\">Sync Time with Samba NTP Server<\/p>\n<\/div>\n<p><strong>5.<\/strong>\u00a0You might want the local time to be automatically synchronized with samba AD time server. In order to achieve this setting, add a scheduled job to run every hour by issuing\u00a0<a href=\"https:\/\/www.tecmint.com\/11-cron-scheduling-task-examples-in-linux\/\" target=\"_blank\" rel=\"noopener noreferrer\">crontab -e command<\/a>\u00a0and append the following line:<\/p>\n<pre>0   *\/1\t  *   *   *   \/usr\/sbin\/ntpdate tecmint.lan &gt; \/var\/log\/ntpdate.lan 2&gt;&amp;1\r\n<\/pre>\n<div id=\"attachment_25590\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Auto-Sync-Time-with-Samba-NTP.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25590\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Auto-Sync-Time-with-Samba-NTP.png\" sizes=\"auto, (max-width: 781px) 100vw, 781px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Auto-Sync-Time-with-Samba-NTP.png 781w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Auto-Sync-Time-with-Samba-NTP-768x316.png 768w\" alt=\"Auto Sync Time with Samba NTP\" width=\"781\" height=\"321\" aria-describedby=\"caption-attachment-25590\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25590\" class=\"wp-caption-text\">Auto Sync Time with Samba NTP<\/p>\n<\/div>\n<h3>Step 2: Prepare Samba4 AD DC for iRedMail Integration<\/h3>\n<p><strong>6.<\/strong>\u00a0Now, move to a\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-ad-from-windows-via-rsat\/\" target=\"_blank\" rel=\"noopener noreferrer\">Windows machine with RSAT tools installed<\/a>\u00a0to manage Samba4 Active Directory as described in this tutorial\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-ad-from-windows-via-rsat\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<p>Open\u00a0<strong>DNS Manager<\/strong>, go to your domain\u00a0<strong>Forward Lookup Zones<\/strong>\u00a0and add a new\u00a0<strong>A<\/strong>\u00a0record, an\u00a0<strong>MX<\/strong>\u00a0record and a\u00a0<strong>PTR<\/strong>\u00a0record to point to your iRedMail system IP address. Use the below screenshots as a guide.<\/p>\n<p>Add\u00a0<strong>A<\/strong>\u00a0record (replace the name and the IP Address of iRedMail machine accordingly).<\/p>\n<div id=\"attachment_25592\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-DNS-A-Record-for-iRedMail.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25592\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-DNS-A-Record-for-iRedMail.png\" sizes=\"auto, (max-width: 823px) 100vw, 823px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-DNS-A-Record-for-iRedMail.png 823w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-DNS-A-Record-for-iRedMail-768x498.png 768w\" alt=\"Create DNS A Record for iRedMail\" width=\"823\" height=\"534\" aria-describedby=\"caption-attachment-25592\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25592\" class=\"wp-caption-text\">Create DNS A Record for iRedMail<\/p>\n<\/div>\n<p>Add\u00a0<strong>MX<\/strong>\u00a0record (leave child domain blank and add a 10 priority for this mail server).<\/p>\n<div id=\"attachment_25593\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-DNS-MX-Record-for-iRedMail.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25593\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-DNS-MX-Record-for-iRedMail.png\" sizes=\"auto, (max-width: 824px) 100vw, 824px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-DNS-MX-Record-for-iRedMail.png 824w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-DNS-MX-Record-for-iRedMail-768x538.png 768w\" alt=\"Create DNS MX Record for iRedMail\" width=\"824\" height=\"577\" aria-describedby=\"caption-attachment-25593\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25593\" class=\"wp-caption-text\">Create DNS MX Record for iRedMail<\/p>\n<\/div>\n<p>Add\u00a0<strong>PTR<\/strong>\u00a0record by expanding to\u00a0<strong>Reverse Lookup Zones<\/strong>\u00a0(replace IP address of iRedMail server accordingly). In case you haven\u2019t configured a reverse zone for your domain controller so far, read the following tutorial:<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/manage-samba4-dns-group-policy-from-windows\/\" target=\"_blank\" rel=\"noopener noreferrer\">Manage Samba4 DNS Group Policy from Windows<\/a><\/li>\n<\/ol>\n<div id=\"attachment_25594\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-DNS-PTR-Record-for-iRedMail.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25594\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-DNS-PTR-Record-for-iRedMail.png\" sizes=\"auto, (max-width: 847px) 100vw, 847px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-DNS-PTR-Record-for-iRedMail.png 847w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-DNS-PTR-Record-for-iRedMail-768x560.png 768w\" alt=\"Create DNS PTR Record for iRedMail\" width=\"847\" height=\"618\" aria-describedby=\"caption-attachment-25594\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25594\" class=\"wp-caption-text\">Create DNS PTR Record for iRedMail<\/p>\n<\/div>\n<p><strong>7.<\/strong>\u00a0After you\u2019ve added the basic DNS records which make a mail server to function properly, move to the iRedMail machine, install\u00a0<strong>bind-utils<\/strong>\u00a0package and query the newly added mail records as suggested on the below excerpt.<\/p>\n<p>Samba4 AD DC DNS server should respond with the DNS records added in the previous step.<\/p>\n<pre># yum install bind-utils\r\n# host tecmint.lan\r\n# host mail.tecmint.lan\r\n# host 192.168.1.245\r\n<\/pre>\n<div id=\"attachment_25595\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Install-Bind-and-Query-Mail-Records.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25595\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Install-Bind-and-Query-Mail-Records.png\" alt=\"Install Bind and Query Mail Records\" width=\"687\" height=\"304\" aria-describedby=\"caption-attachment-25595\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25595\" class=\"wp-caption-text\">Install Bind and Query Mail Records<\/p>\n<\/div>\n<p>From a Windows machine, open a\u00a0<strong>Command Prompt<\/strong>\u00a0window and issue\u00a0<a href=\"https:\/\/www.tecmint.com\/8-linux-nslookup-commands-to-troubleshoot-dns-domain-name-server\/\" target=\"_blank\" rel=\"noopener noreferrer\">nslookup command<\/a>\u00a0against the above mail server records.<\/p>\n<p><strong>8.<\/strong>\u00a0As a final pre-requirement, create a new user account with minimal privileges in Samba4 AD DC with the name\u00a0<strong>vmail<\/strong>, choose a strong password for this user and make sure the password for this user never expires.<\/p>\n<p>The vmail user account will be used by iRedMail services to query Samba4 AD DC LDAP database and pull the email accounts.<\/p>\n<p>To create the vmail account, use ADUC graphical tool from a Windows machine joined to the realm with RSAT tools installed as illustrated on the below screenshots or use samba-tool command line directly from a domain controller as explained on the following topic.<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/manage-samba4-active-directory-linux-command-line\/\" target=\"_blank\" rel=\"noopener noreferrer\">Manage Samba4 Active Directory from Linux Command Line<\/a><\/li>\n<\/ol>\n<p>In this guide, we\u2019ll use the first method mentioned above.<\/p>\n<div id=\"attachment_25596\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Active-Directory-Users-and-Computers.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25596\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Active-Directory-Users-and-Computers.png\" sizes=\"auto, (max-width: 830px) 100vw, 830px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Active-Directory-Users-and-Computers.png 830w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Active-Directory-Users-and-Computers-768x660.png 768w\" alt=\"Active Directory Users and Computers\" width=\"830\" height=\"713\" aria-describedby=\"caption-attachment-25596\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25596\" class=\"wp-caption-text\">Active Directory Users and Computers<\/p>\n<\/div>\n<div id=\"attachment_25597\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-New-User-for-iRedMail.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25597\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-New-User-for-iRedMail.png\" sizes=\"auto, (max-width: 888px) 100vw, 888px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-New-User-for-iRedMail.png 888w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-New-User-for-iRedMail-768x438.png 768w\" alt=\"Create New User for iRedMail\" width=\"888\" height=\"506\" aria-describedby=\"caption-attachment-25597\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25597\" class=\"wp-caption-text\">Create New User for iRedMail<\/p>\n<\/div>\n<div id=\"attachment_25598\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Set-Strong-Password-for-User.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25598\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Set-Strong-Password-for-User.png\" sizes=\"auto, (max-width: 918px) 100vw, 918px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Set-Strong-Password-for-User.png 918w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Set-Strong-Password-for-User-768x470.png 768w\" alt=\"Set Strong Password for User\" width=\"918\" height=\"562\" aria-describedby=\"caption-attachment-25598\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25598\" class=\"wp-caption-text\">Set Strong Password for User<\/p>\n<\/div>\n<p><strong>9.<\/strong>\u00a0From iRedMail system, test the vmail user ability to query Samba4 AD DC LDAP database by issuing the below command. The returned result should be a total number of objects entries for your domain as illustrated on the below screenshots.<\/p>\n<pre># ldapsearch -x -h tecmint.lan -D 'vmail@tecmint.lan' -W -b 'cn=users,dc=tecmint,dc=lan'\r\n<\/pre>\n<p><strong>Note<\/strong>: Replace the domain name and the LDAP base dn in Samba4 AD (\u2018<strong>cn=users,dc=tecmint,dc=lan<\/strong>\u2018) accordingly.<\/p>\n<div id=\"attachment_25599\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Query-Samba4-AD-DC-LDAP.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25599\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Query-Samba4-AD-DC-LDAP.png\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Query-Samba4-AD-DC-LDAP.png 816w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Query-Samba4-AD-DC-LDAP-768x667.png 768w\" alt=\"Query Samba4 AD DC LDAP\" width=\"816\" height=\"709\" aria-describedby=\"caption-attachment-25599\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25599\" class=\"wp-caption-text\">Query Samba4 AD DC LDAP<\/p>\n<\/div>\n<h3>Step 3: Integrate iRedMail Services to Samba4 AD DC<\/h3>\n<p><strong>10.<\/strong>\u00a0Now it\u2019s time to tamper with iRedMail services (Postfix, Dovecot and Roundcube) in order to query Samba4 Domain Controller for mail accounts.<\/p>\n<p>The first service to be modified will be the MTA agent, Postfix. Issue the following commands to disable a series of MTA settings, add your domain name to Postfix local domain and mailbox domains and use Dovecot agent to deliver received mails locally to user mailboxes.<\/p>\n<pre># postconf -e virtual_alias_maps=' '\r\n# postconf -e sender_bcc_maps=' '\r\n# postconf -e recipient_bcc_maps= ' '\r\n# postconf -e relay_domains=' '\r\n# postconf -e relay_recipient_maps=' '\r\n# postconf -e sender_dependent_relayhost_maps=' '\r\n# postconf -e smtpd_sasl_local_domain='tecmint.lan'\t#Replace with your own domain\r\n# postconf -e virtual_mailbox_domains='tecmint.lan'\t#Replace with your own domain\t\r\n# postconf -e transport_maps='hash:\/etc\/postfix\/transport'\r\n# postconf -e smtpd_sender_login_maps='proxy:ldap:\/etc\/postfix\/ad_sender_login_maps.cf'  # Check SMTP senders\r\n# postconf -e virtual_mailbox_maps='proxy:ldap:\/etc\/postfix\/ad_virtual_mailbox_maps.cf'  # Check local mail accounts\r\n# postconf -e virtual_alias_maps='proxy:ldap:\/etc\/postfix\/ad_virtual_group_maps.cf'  # Check local mail lists\r\n# cp \/etc\/postfix\/transport \/etc\/postfix\/transport.backup\t# Backup transport conf file\r\n# echo \"tecmint.lan dovecot\" &gt; \/etc\/postfix\/transport\t\t# Add your domain with dovecot transport\r\n# cat \/etc\/postfix\/transport\t\t\t\t\t# Verify transport file\r\n# postmap hash:\/etc\/postfix\/transport\r\n<\/pre>\n<p><strong>11.<\/strong>\u00a0Next, create Postfix\u00a0<code>\/etc\/postfix\/ad_sender_login_maps.cf<\/code>\u00a0configuration file with your favorite text editor and add the below configuration.<\/p>\n<pre>server_host     = tecmint.lan\r\nserver_port     = 389\r\nversion         = 3\r\nbind            = yes\r\nstart_tls       = no\r\nbind_dn         = vmail@tecmint.lan\r\nbind_pw         = ad_vmail_account_password\r\nsearch_base     = dc=tecmint,dc=lan\r\nscope           = sub\r\nquery_filter    = (&amp;(userPrincipalName=%s)(objectClass=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))\r\nresult_attribute= userPrincipalName\r\ndebuglevel      = 0\r\n<\/pre>\n<p><strong>12.<\/strong>\u00a0Create\u00a0<code>\/etc\/postfix\/ad_virtual_mailbox_maps.cf<\/code>\u00a0with the following configuration.<\/p>\n<pre>server_host     = tecmint.lan\r\nserver_port     = 389\r\nversion         = 3\r\nbind            = yes\r\nstart_tls       = no\r\nbind_dn         = vmail@tecmint.lan\r\nbind_pw         = ad_vmail_account_password\r\nsearch_base     = dc=tecmint,dc=lan\r\nscope           = sub\r\nquery_filter    = (&amp;(objectclass=person)(userPrincipalName=%s))\r\nresult_attribute= userPrincipalName\r\nresult_format   = %d\/%u\/Maildir\/\r\ndebuglevel      = 0\r\n<\/pre>\n<p><strong>13.<\/strong>\u00a0Create\u00a0<code>\/etc\/postfix\/ad_virtual_group_maps.cf<\/code>\u00a0with the below configuration.<\/p>\n<pre>server_host     = tecmint.lan\r\nserver_port     = 389\r\nversion         = 3\r\nbind            = yes\r\nstart_tls       = no\r\nbind_dn         = vmail@tecmint.lan\r\nbind_pw         = ad_vmail_account_password\r\nsearch_base     = dc=tecmint,dc=lan\r\nscope           = sub\r\nquery_filter    = (&amp;(objectClass=group)(mail=%s))\r\nspecial_result_attribute = member\r\nleaf_result_attribute = mail\r\nresult_attribute= userPrincipalName\r\ndebuglevel      = 0\r\n<\/pre>\n<p>On all three configuration files replace the values from\u00a0<strong>server_host<\/strong>,\u00a0<strong>bind_dn<\/strong>,\u00a0<strong>bind_pw<\/strong>\u00a0and\u00a0<strong>search_base<\/strong>\u00a0to reflect your own domain custom settings.<\/p>\n<p><strong>14.<\/strong>\u00a0Next, open Postfix main configuration file and search and disable iRedAPD\u00a0<strong>check_policy_service<\/strong>\u00a0and\u00a0<strong>smtpd_end_of_data_restrictions<\/strong>\u00a0by adding a comment\u00a0<code>#<\/code>\u00a0in front of the following lines.<\/p>\n<pre># nano \/etc\/postfix\/main.cf\r\n<\/pre>\n<p>Comment the following lines:<\/p>\n<pre>#check_policy_service inet:127.0.0.1:7777\r\n#smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:7777\r\n<\/pre>\n<p><strong>15.<\/strong>\u00a0Now, verify Postfix binding to Samba AD using an existing domain user and a domain group by issuing a series of queries as presented in the following examples.<\/p>\n<p>The result should be similar as illustrated on the bellow screenshot.<\/p>\n<pre># postmap -q tecmint_user@tecmint.lan ldap:\/etc\/postfix\/ad_virtual_mailbox_maps.cf\r\n# postmap -q tecmint_user@tecmint.lan ldap:\/etc\/postfix\/ad_sender_login_maps.cf\r\n# postmap -q linux_users@tecmint.lan ldap:\/etc\/postfix\/ad_virtual_group_maps.cf\r\n<\/pre>\n<div id=\"attachment_25600\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Verify-Postfix-Binding-to-Samba-AD.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25600\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Verify-Postfix-Binding-to-Samba-AD.png\" sizes=\"auto, (max-width: 786px) 100vw, 786px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Verify-Postfix-Binding-to-Samba-AD.png 786w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Verify-Postfix-Binding-to-Samba-AD-768x147.png 768w\" alt=\"Verify Postfix Binding to Samba AD\" width=\"786\" height=\"150\" aria-describedby=\"caption-attachment-25600\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25600\" class=\"wp-caption-text\">Verify Postfix Binding to Samba AD<\/p>\n<\/div>\n<p>Replace AD user and group accounts accordingly. Also, assure that the AD group you\u2019re using has some AD users members assigned to it.<\/p>\n<p><strong>16.<\/strong>\u00a0On the next step modify Dovecot configuration file in order to query Samba4 AD DC. Open file\u00a0<code>\/etc\/dovecot\/dovecot-ldap.conf<\/code>\u00a0for editing and add the following lines.<\/p>\n<pre>hosts           = tecmint.lan:389\r\nldap_version    = 3\r\nauth_bind       = yes\r\ndn              = vmail@tecmint.lan\r\ndnpass          = ad_vmail_password\r\nbase            = dc=tecmint,dc=lan\r\nscope           = subtree\r\nderef           = never\r\nuser_filter     = (&amp;(userPrincipalName=%u)(objectClass=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))\r\npass_filter     = (&amp;(userPrincipalName=%u)(objectClass=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))\r\npass_attrs      = userPassword=password\r\ndefault_pass_scheme = CRYPT\r\nuser_attrs      = =home=\/var\/vmail\/vmail1\/%Ld\/%Ln\/Maildir\/,=mail=maildir:\/var\/vmail\/vmail1\/%Ld\/%Ln\/Maildir\/\r\n<\/pre>\n<p>The mailbox of a Samba4 AD account will be stored in\u00a0<strong>\/var\/vmail\/vmail1\/your_domain.tld\/your_domain_user\/Maildir\/<\/strong>\u00a0location on the Linux system.<\/p>\n<p><strong>17.<\/strong>\u00a0Make sure pop3 and imap protocols are enabled in dovecot main configuration file. Verify if quota and acl mail plugins are also enabled by opening file\u00a0<code>\/etc\/dovecot\/dovecot.conf<\/code>\u00a0and check if these values are present.<\/p>\n<div id=\"attachment_25601\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Enable-Pop3-Imap-in-Dovecot.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25601\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Enable-Pop3-Imap-in-Dovecot.png\" alt=\"Enable Pop3 and Imap in Dovecot\" width=\"485\" height=\"385\" aria-describedby=\"caption-attachment-25601\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25601\" class=\"wp-caption-text\">Enable Pop3 and Imap in Dovecot<\/p>\n<\/div>\n<p><strong>18.<\/strong>\u00a0Optionally, if you want to set a global hard quota to not exceed the maximum of 500 MB of storage for each domain user, add the following line in\u00a0<strong>\/etc\/dovecot\/dovecot.conf<\/strong>\u00a0file.<\/p>\n<pre>quota_rule = *:storage=500M \r\n<\/pre>\n<p><strong>19.<\/strong>\u00a0Finally, in order to apply all changes made so far, restart and verify the status of Postfix and Dovecot daemons by issuing the below commands with root privileges.<\/p>\n<pre># systemctl restart postfix dovecot\r\n# systemctl status postfix dovecot\r\n<\/pre>\n<p><strong>20.<\/strong>\u00a0In order to test mail server configuration from the command line using IMAP protocol use\u00a0<strong>telnet<\/strong>\u00a0or\u00a0<a href=\"https:\/\/www.tecmint.com\/check-remote-port-in-linux\/\" target=\"_blank\" rel=\"noopener noreferrer\">netcat command<\/a>\u00a0as presented in the below example.<\/p>\n<pre># nc localhost 143\r\na1 LOGIN ad_user@your_domain.tld ad_user_password\r\na2 LIST \u201c\u201d \u201c*\u201d\r\na3 LOGOUT\r\n<\/pre>\n<div id=\"attachment_25602\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Test-iRedMail-Configuration.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25602\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Test-iRedMail-Configuration.png\" sizes=\"auto, (max-width: 1051px) 100vw, 1051px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Test-iRedMail-Configuration.png 1051w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Test-iRedMail-Configuration-768x286.png 768w\" alt=\"Test iRedMail Configuration\" width=\"1051\" height=\"392\" aria-describedby=\"caption-attachment-25602\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25602\" class=\"wp-caption-text\">Test iRedMail Configuration<\/p>\n<\/div>\n<p>If you can perform an IMAP login from the command line with a Samba4 user account then iRedMail server seems ready to send and receive mail for Active Directory accounts.<\/p>\n<p>On the next tutorial will discuss how to integrate Roundcube webmail with Samba4 AD DC and enable Global LDAP Address Book, customize Roudcube, access Roundcube web interface from a browser and disable some unneeded iRedMail services.<\/p>\n<h1 class=\"post-title\">How to Integrate iRedMail Roundcube with Samba4 AD DC \u2013 Part 12<\/h1>\n<p><a href=\"https:\/\/www.tecmint.com\/install-and-configure-roundcube-webmail-for-postfix-mail-server\/\" target=\"_blank\" rel=\"noopener noreferrer\">Roundcube<\/a>, one of the most used webmail user agent in Linux, offers a modern web interface for end users to interact with all mail services in order to read, compose and send e-mails. Roundcube supports a variety of mail protocols, including the secured ones, such IMAPS, POP3S or submission.<\/p>\n<p>In this topic we\u2019ll discuss how to configure Roundcube in iRedMail with IMAPS and submission secured ports to retrieve and send emails for Samba4 AD accounts, how to access iRedMail Roundcube web interface from a browser and add a web address alias, how to enable Samba4 AD integration for Global LDAP Address Book and how to disable some unneeded iRedMail services.<\/p>\n<h4>Requirements<\/h4>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/install-iredmail-on-centos-7-for-samba4-ad-integration\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Install iRedMail on CentOS 7 for Samba4 AD Integration<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/integrate-iredmail-to-samba4-ad-dc-on-centos-7\/\" target=\"_blank\" rel=\"noopener noreferrer\">Configure iRedMail on CentOS 7 for Samba4 AD Integration<\/a><\/li>\n<\/ol>\n<h3>Step 1: Declare E-mail Address for Domain Accounts in Samba4 AD DC<\/h3>\n<p><strong>1.<\/strong>\u00a0In order send and receive mail for\u00a0<strong>Samba4 AD DC<\/strong>\u00a0domain accounts, you need to edit each user account and explicitly set email filed with the proper e-mail address by opening ADUC tool from a\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-ad-from-windows-via-rsat\/\" target=\"_blank\" rel=\"noopener noreferrer\">Windows machine with RSAT tools installed<\/a>\u00a0and joined to Samba4 AD as illustrated in the below image.<\/p>\n<div id=\"attachment_25629\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Active-Directory-User-and-Computers.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25629\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Active-Directory-User-and-Computers.jpg\" sizes=\"auto, (max-width: 991px) 100vw, 991px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Active-Directory-User-and-Computers.jpg 991w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Active-Directory-User-and-Computers-768x582.jpg 768w\" alt=\"Add Email Account to Join Samba4 AD DC\" width=\"991\" height=\"751\" aria-describedby=\"caption-attachment-25629\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25629\" class=\"wp-caption-text\">Add Email Account to Join Samba4 AD DC<\/p>\n<\/div>\n<p><strong>2.<\/strong>\u00a0Similarly, to use mail lists, you need to create groups in ADUC, add the corresponding e-mail address for each group and assign the proper user accounts as members of the group.<\/p>\n<p>With this setup created as a mail list, all members mailboxes of a Samba4 AD group will receive mail destined for an AD group e-mail address. Use the below screenshots as a guide to declare e-mail filed for a Samba4 group account and add domain users as members of the group.<\/p>\n<p>Make sure all accounts members added to a group have their e-mail address declared.<\/p>\n<div id=\"attachment_25631\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-Group-Admin-for-Samba4-AD-DC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25631\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-Group-Admin-for-Samba4-AD-DC.png\" sizes=\"auto, (max-width: 1011px) 100vw, 1011px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-Group-Admin-for-Samba4-AD-DC.png 1011w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Create-Group-Admin-for-Samba4-AD-DC-768x425.png 768w\" alt=\"Create Group Admin for Samba4 AD DC\" width=\"1011\" height=\"559\" aria-describedby=\"caption-attachment-25631\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25631\" class=\"wp-caption-text\">Create Group Admin for Samba4 AD DC<\/p>\n<\/div>\n<div id=\"attachment_25630\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Add-Users-to-Group.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25630\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Add-Users-to-Group.png\" alt=\"Add Users to Group\" width=\"603\" height=\"446\" aria-describedby=\"caption-attachment-25630\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25630\" class=\"wp-caption-text\">Add Users to Group<\/p>\n<\/div>\n<p>In this example, all mails sent to\u00a0<strong>admins@tecmint.lan<\/strong>\u00a0e-mail address declared for \u2018<strong>Domain Admins<\/strong>\u2019 group will be received by each member mailbox of this group.<\/p>\n<p><strong>3.<\/strong>\u00a0An alternative method that you can use to declare the e-mail address for a Samba4 AD account is by creating a user or a group with samba-tool command line directly from one of the AD DC console and specify the e-mail address with the\u00a0<code>--mail-address<\/code>\u00a0flag.<\/p>\n<p>Use one of the following command syntax to create a user with e-mail address specified:<\/p>\n<pre># samba-tool user add  --mail-address=user_email@domain.tld  --surname=your_surname  --given-name=your_given_name  your_ad_user\r\n<\/pre>\n<p>Create a group with e-mail address specified:<\/p>\n<pre># samba-tool group add  --mail-address=group_email@domain.tld  your_ad_group\r\n<\/pre>\n<p>To add members to a group:<\/p>\n<pre># samba-tool group addmembers your_group user1,user2,userX\r\n<\/pre>\n<p>To list all available samba-tool command fields for a user or a group use the following syntax:<\/p>\n<pre># samba-tool user add -h\r\n# samba-tool group add -h\r\n<\/pre>\n<h3>Step 3: Secure Roundcube Webmail<\/h3>\n<p><strong>4.<\/strong>\u00a0Before modifying Roundcube configuration file, first, use\u00a0<a href=\"https:\/\/www.tecmint.com\/20-netstat-commands-for-linux-network-management\/\" target=\"_blank\" rel=\"noopener noreferrer\">netstat command<\/a>\u00a0piped through egrep filter to list the sockets that\u00a0<a href=\"https:\/\/www.tecmint.com\/configure-postfix-and-dovecot-with-virtual-domain-users-in-linux\/\" target=\"_blank\" rel=\"noopener noreferrer\">Dovecot and Postfix<\/a>\u00a0listen to and assure that the properly secured ports (993 for IMAPS and 587 for submission) are active and enabled.<\/p>\n<pre># netstat -tulpn| egrep 'dovecot|master'\r\n<\/pre>\n<p><strong>5.<\/strong>\u00a0To enforce mail reception and transfer between Roundcube and iRedMail services on secured IMAP and SMTP ports, open Roundcube configuration file located in\u00a0<strong>\/var\/www\/roundcubemail\/config\/config.inc.php<\/strong>\u00a0and make sure you change the following lines, for localhost in this case, as shown in the below excerpt:<\/p>\n<pre>\/\/ For IMAPS\r\n$config['default_host'] = 'ssl:\/\/127.0.0.1';\r\n$config['default_port'] = 993;\r\n$config['imap_auth_type'] = 'LOGIN';\r\n\r\n\/\/ For SMTP\r\n$config['smtp_server'] = 'tls:\/\/127.0.0.1';\r\n$config['smtp_port'] = 587;\r\n$config['smtp_user'] = '%u';\r\n$config['smtp_pass'] = '%p';\r\n$config['smtp_auth_type'] = 'LOGIN';\r\n<\/pre>\n<p>This setup is highly recommended in case Roudcube is installed on a remote host than the one that provides mail services (IMAP, POP3 or SMTP daemons).<\/p>\n<p><strong>6.<\/strong>\u00a0Next, don\u2019t close the configuration file, search and make the following small changes in order for Roundcube to be visited only via HTTPS protocol, to hide the version number and to automatically append the domain name for accounts who login in the web interface.<\/p>\n<pre>$config['force_https'] = true;\r\n$config['useragent'] = 'Your Webmail'; \/\/ Hide version number\r\n$config['username_domain'] = 'domain.tld'\r\n<\/pre>\n<p><strong>7.<\/strong>\u00a0Also, disable the following plugins:\u00a0<strong>managesieve<\/strong>\u00a0and\u00a0<strong>password<\/strong>\u00a0by adding a comment\u00a0<code>(\/\/)<\/code>\u00a0in front of the line that starts with\u00a0<strong>$config[\u2018plugins\u2019]<\/strong>.<\/p>\n<p>Users will change their password from a Windows or Linux machine joined to Samba4 AD DC once they login and authenticate to the domain. A sysadmin will globally manage all sieve rules for domain accounts.<\/p>\n<pre>\/\/ $config['plugins'] = array('managesieve', 'password');\r\n<\/pre>\n<p><strong>8.<\/strong>\u00a0Finally, save and close the configuration file and visit Roundcube Webmail by opening a browser and navigate to iRedMail IP address or FQDN\/mail location via HTTPS protocol.<\/p>\n<p>The first time when you visit Roundcube an alert should appear on the browser due to the Self-Signed Certificate the web server uses. Accept the certificate and login with a Samba AD account credentials.<\/p>\n<pre>https:\/\/iredmail-FQDN\/mail\r\n<\/pre>\n<div id=\"attachment_25632\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Roundcube-Webmail-Login.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25632\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Roundcube-Webmail-Login.png\" sizes=\"auto, (max-width: 1049px) 100vw, 1049px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Roundcube-Webmail-Login.png 1049w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Roundcube-Webmail-Login-768x430.png 768w\" alt=\"Roundcube Webmail Login\" width=\"1049\" height=\"587\" aria-describedby=\"caption-attachment-25632\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25632\" class=\"wp-caption-text\">Roundcube Webmail Login<\/p>\n<\/div>\n<h3>Step 3: Enable Samba AD Contacts in Roundcube<\/h3>\n<p><strong>9.<\/strong>\u00a0To configure Samba AD Global LDAP Address Book to appear Roundcube Contacts, open Roundcube configuration file again for editing and make the following changes:<\/p>\n<p>Navigate to the bottom of the file and identify the section that begins with \u2018<strong># Global LDAP Address Book with AD<\/strong>\u2019, delete all its content until the end of the file and replace it with the following code block:<\/p>\n<pre># Global LDAP Address Book with AD.\r\n#\r\n$config['ldap_public'][\"global_ldap_abook\"] = array(\r\n    'name'          =&gt; 'tecmint.lan',\r\n    'hosts'         =&gt; array(\"tecmint.lan\"),\r\n    'port'          =&gt; 389,\r\n    'use_tls'       =&gt; false,\r\n    'ldap_version'  =&gt; '3',\r\n    'network_timeout' =&gt; 10,\r\n    'user_specific' =&gt; false,\r\n\r\n    'base_dn'       =&gt; \"dc=tecmint,dc=lan\",\r\n    'bind_dn'       =&gt; \"vmail@tecmint.lan\",\r\n    'bind_pass'     =&gt; \"your_password\",\r\n    'writable'      =&gt; false,\r\n\r\n    'search_fields' =&gt; array('mail', 'cn', 'sAMAccountName', 'displayname', 'sn', 'givenName'),\r\n\t\r\n    'fieldmap' =&gt; array(\r\n        'name'        =&gt; 'cn',\r\n        'surname'     =&gt; 'sn',\r\n        'firstname'   =&gt; 'givenName',\r\n        'title'       =&gt; 'title',\r\n        'email'       =&gt; 'mail:*',\r\n        'phone:work'  =&gt; 'telephoneNumber',\r\n        'phone:mobile' =&gt; 'mobile',\r\n\r\n        'department'  =&gt; 'departmentNumber',\r\n        'notes'       =&gt; 'description',\r\n\r\n    ),\r\n    'sort'          =&gt; 'cn',\r\n    'scope'         =&gt; 'sub',\r\n    'filter' =&gt; '(&amp;(mail=*)(|(&amp;(objectClass=user)(!(objectClass=computer)))(objectClass=group)))',\r\n    'fuzzy_search'  =&gt; true,\r\n    'vlv'           =&gt; false,\r\n    'sizelimit'     =&gt; '0',\r\n    'timelimit'     =&gt; '0',\r\n    'referrals'     =&gt; false,\r\n);\r\n<\/pre>\n<p>On this block of code replace\u00a0<strong>name<\/strong>,\u00a0<strong>hosts<\/strong>,\u00a0<strong>base_dn<\/strong>,\u00a0<strong>bind_dn<\/strong>\u00a0and\u00a0<strong>bind_pass<\/strong>\u00a0values accordingly.<\/p>\n<p><strong>10.<\/strong>\u00a0After you\u2019ve made all the required changes, save and close the file, login to Roundcube webmail interface and go to Address Book menu.<\/p>\n<p>Hit on your\u00a0<strong>Global Address Book<\/strong>\u00a0chosen name and a contact list of all domain accounts (users and groups) with their specified e-mail address should be visible.<\/p>\n<div id=\"attachment_25633\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Roundcube-User-Contact-List.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25633\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Roundcube-User-Contact-List.png\" sizes=\"auto, (max-width: 1054px) 100vw, 1054px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Roundcube-User-Contact-List.png 1054w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Roundcube-User-Contact-List-768x513.png 768w\" alt=\"Roundcube User Contact List\" width=\"1054\" height=\"704\" aria-describedby=\"caption-attachment-25633\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25633\" class=\"wp-caption-text\">Roundcube User Contact List<\/p>\n<\/div>\n<h3>Step 4: Add an Alias for Roundcube Webmail Interface<\/h3>\n<p><strong>11.<\/strong>\u00a0To visit Roundcube at a web address with the following form\u00a0<strong>https:\/\/webmail.domain.tld<\/strong>\u00a0instead of the old address provided by default by iRedMail you need to make the following changes.<\/p>\n<p>From a joined Windows machine with RSAT tools installed, open DNS Manager and add a new CNAME record for iRedMail FQDN, named webmail, as illustrated in the following image.<\/p>\n<div id=\"attachment_25634\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/DNS-Webmail-Properties.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25634\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/DNS-Webmail-Properties.jpg\" sizes=\"auto, (max-width: 963px) 100vw, 963px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/DNS-Webmail-Properties.jpg 963w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/DNS-Webmail-Properties-768x561.jpg 768w\" alt=\"DNS Webmail Properties\" width=\"963\" height=\"703\" aria-describedby=\"caption-attachment-25634\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25634\" class=\"wp-caption-text\">DNS Webmail Properties<\/p>\n<\/div>\n<p><strong>12.<\/strong>\u00a0Next, on iRedMail machine, open Apache web server SSL configuration file located in\u00a0<strong>\/etc\/httpd\/conf.d\/ssl.conf<\/strong>\u00a0and change DocumentRoot directive to point to\u00a0<strong>\/var\/www\/roundcubemail\/<\/strong>\u00a0system path.<\/p>\n<p>file\u00a0<strong>\/etc\/httpd\/conf.d\/ssl.conf<\/strong>\u00a0excerpt:<\/p>\n<pre>DocumentRoot \u201c\/var\/www\/roundcubemail\/\u201d\r\n<\/pre>\n<p>Restart Apache daemon to apply changes.<\/p>\n<pre># systemctl restart httpd\r\n<\/pre>\n<p><strong>13.<\/strong>\u00a0Now, point the browser to the following address and Roundcube interface should appear. Accept the Self-Signed Cerificate error to continue to login page. Replace domain.tld from this example with your own domain name.<\/p>\n<pre>https:\/\/webmail.domain.tld\r\n<\/pre>\n<h3>Step 5: Disable iRedMail Unused Services<\/h3>\n<p><strong>14.<\/strong>\u00a0Since iRedMail daemons are configured to query Samba4 AD DC LDAP server for account information and other resources, you can safely stop and disable some local services on iRedMail machine, such as LDAP database server and iredpad service by issuing the following commands.<\/p>\n<pre># systemctl stop slapd iredpad\r\n# systemctl disable slapd iredpad\r\n<\/pre>\n<p><strong>15.<\/strong>\u00a0Also, disable some scheduled tasks performed by iRedMail, such as LDAP database backup and iRedPad tracking records by adding a comment\u00a0<strong>(#)<\/strong>\u00a0in front of each line from crontab file as illustrated on the below screenshot.<\/p>\n<pre># crontab -e\r\n<\/pre>\n<div id=\"attachment_25636\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Disable-iRedMail-Tasks.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25636\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Disable-iRedMail-Tasks.png\" alt=\"Disable iRedMail Tasks\" width=\"762\" height=\"269\" aria-describedby=\"caption-attachment-25636\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25636\" class=\"wp-caption-text\">Disable iRedMail Tasks<\/p>\n<\/div>\n<h3>Step 6: Use Mail Alias in Postfix<\/h3>\n<p><strong>16.<\/strong>\u00a0To redirect all locally generated mail (destined for postmaster and subsequently redirected to root account) to a specific Samba4 AD account, open Postfix aliases configuration file located in\u00a0<strong>\/etc\/postfix\/aliases<\/strong>\u00a0and modify root line as follows:<\/p>\n<pre>root: \tyour_AD_email_account@domain.tld\r\n<\/pre>\n<p><strong>17.<\/strong>\u00a0Apply the aliases configuration file so that Postfix can read it in its own format by executing newaliases command and test if the mail gets sent to the proper domain e-email account by issuing the following command.<\/p>\n<pre># echo \u201cTest mail\u201d | mail -s \u201cThis is root\u2019s email\u201d root\r\n<\/pre>\n<p><strong>18.<\/strong>\u00a0After the mail has been sent, login to Roundcube webmail with the domain account you\u2019ve setup for mail redirection and verify the previously sent mail should be received in your account Inbox.<\/p>\n<div id=\"attachment_25635\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Verify-User-Mail.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25635\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Verify-User-Mail.png\" sizes=\"auto, (max-width: 1046px) 100vw, 1046px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Verify-User-Mail.png 1046w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Verify-User-Mail-768x520.png 768w\" alt=\"Verify User Mail\" width=\"1046\" height=\"708\" aria-describedby=\"caption-attachment-25635\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25635\" class=\"wp-caption-text\">Verify User Mail<\/p>\n<\/div>\n<p>That\u2019all! Now, you have a fully working mail server integrated with Samba4 Active Directory. Domain accounts can send and receive mail for their internal domain or for other external domains.<\/p>\n<p>The configurations used in this tutorial can be successfully applied to integrate an iRedMail server to a Windows Server 2012 R2 or 2016 Active Directory.<\/p>\n<h1 class=\"post-title\">How to Configure Thunderbird with iRedMail for Samba4 AD \u2013 Part 13<\/h1>\n<p>This tutorial will guide you on how to configure Mozilla Thunderbird client with an iRedMail server in order to send and receive mail via IMAPS and SMTP submission protocols, how to setup contacts database with Samba AD LDAP server and how to configure other related mail features, such as enabling Thunderbird contacts via LDAP database offline replica.<\/p>\n<p>The process of installing and configuring Mozilla Thunderbird client described here is valid for Thunderbird clients installed on Windows or Linux operating systems.<\/p>\n<h4>Requirements<\/h4>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/integrate-iredmail-to-samba4-ad-dc-on-centos-7\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Configure and Integrate iRedMail Services to Samba4 AD DC<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/integrate-iredmail-roundcube-with-samba4-ad-dc\/\" target=\"_blank\" rel=\"noopener noreferrer\">Integrate iRedMail Roundcube with Samba4 AD DC<\/a><\/li>\n<\/ol>\n<h3>Step 1: Configure Thunderbird for iRedMail Server<\/h3>\n<p><strong>1.<\/strong>\u00a0After installing Thunderbird mail client, hit on the launcher or shortcut to open the program and on the first screen check E-mail\u00a0<strong>System Integration<\/strong>\u00a0and click on\u00a0<strong>Skip Integration<\/strong>\u00a0button to continue.<\/p>\n<div id=\"attachment_25696\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-System-Integration.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25696\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-System-Integration.png\" alt=\"Thunderbird System Integration\" width=\"481\" height=\"311\" aria-describedby=\"caption-attachment-25696\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25696\" class=\"wp-caption-text\">Thunderbird System Integration<\/p>\n<\/div>\n<p><strong>2.<\/strong>\u00a0On the welcome screen hit on\u00a0<strong>Skip this and use my existing mail<\/strong>\u00a0button and add your name, your Samba account e-mail address and password, check\u00a0<strong>Remember password<\/strong>\u00a0field and hit on\u00a0<strong>Continue<\/strong>\u00a0button to start your mail account setup.<\/p>\n<p>After Thunderbird client tries to identify the correct IMAP settings provided by iRedMail server hit on\u00a0<strong>Manual<\/strong>config button to manually setup Thunderbird.<\/p>\n<div id=\"attachment_25697\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Mail-Account-Setup.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25697\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Mail-Account-Setup.png\" alt=\"Thunderbird Mail Account Setup\" width=\"684\" height=\"591\" aria-describedby=\"caption-attachment-25697\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25697\" class=\"wp-caption-text\">Thunderbird Mail Account Setup<\/p>\n<\/div>\n<p><strong>3.<\/strong>\u00a0After the Mail Account Setup window expands, manually edit IMAP and SMTP settings by adding your proper iRedMail server FQDN, add secured ports for both mail services (993 for IMAPS and 587 for submission), select the proper SSL communication channel for each port and authentication and hit\u00a0<strong>Done<\/strong>\u00a0to complete the setup. Use the below image as a guide.<\/p>\n<div id=\"attachment_25698\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-iRedMail-Settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25698\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-iRedMail-Settings.png\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-iRedMail-Settings.png 816w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-iRedMail-Settings-768x453.png 768w\" alt=\"Thunderbird iRedMail Settings\" width=\"816\" height=\"481\" aria-describedby=\"caption-attachment-25698\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25698\" class=\"wp-caption-text\">Thunderbird iRedMail Settings<\/p>\n<\/div>\n<p><strong>4.<\/strong>\u00a0A new Security Exception window should appear on your screen due to the Self-Signed Certificates your iRedMail server enforces. Check on\u00a0<strong>Permanently store this exception<\/strong>\u00a0and hit on\u00a0<strong>Confirm Security Exception<\/strong>button to add this security exception and the Thunderbird client should be successfully configured.<\/p>\n<div id=\"attachment_25699\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Security-Exception.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25699\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Security-Exception.png\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Security-Exception.png 816w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Security-Exception-768x527.png 768w\" alt=\"Thunderbird Security Exception\" width=\"816\" height=\"560\" aria-describedby=\"caption-attachment-25699\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25699\" class=\"wp-caption-text\">Thunderbird Security Exception<\/p>\n<\/div>\n<p>You will see all received mail for your domain account and you should be able to send or receive mail to and from your domain or other domain accounts.<\/p>\n<div id=\"attachment_25700\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Domain-Mails-Inbox.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25700\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Domain-Mails-Inbox.png\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Domain-Mails-Inbox.png 816w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Domain-Mails-Inbox-768x262.png 768w\" alt=\"Domain Mails Inbox\" width=\"816\" height=\"278\" aria-describedby=\"caption-attachment-25700\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25700\" class=\"wp-caption-text\">Domain Mails Inbox<\/p>\n<\/div>\n<h3>Step 2: Setup Thunderbird Contacts Database with Samba AD LDAP<\/h3>\n<p><strong>5.<\/strong>\u00a0In order for Thunderbird clients to query Samba AD LDAP database for contacts, hit on\u00a0<strong>Settings<\/strong>\u00a0menu by right clicking on your account from the left plane and navigate to\u00a0<strong>Composition &amp; Addressing \u2192 Addressing \u2192 Use a different LDAP server \u2192 Edit Directories<\/strong>\u00a0button as illustrated on the below images.<\/p>\n<div id=\"attachment_25701\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Samba-AD-LDAP-Settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25701\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Samba-AD-LDAP-Settings.png\" sizes=\"auto, (max-width: 783px) 100vw, 783px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Samba-AD-LDAP-Settings.png 783w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Samba-AD-LDAP-Settings-768x486.png 768w\" alt=\"Thunderbird Samba AD LDAP Settings\" width=\"783\" height=\"495\" aria-describedby=\"caption-attachment-25701\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25701\" class=\"wp-caption-text\">Thunderbird Samba AD LDAP Settings<\/p>\n<\/div>\n<div id=\"attachment_25702\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Composition-Addressing-Settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25702\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Composition-Addressing-Settings.png\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Composition-Addressing-Settings.png 816w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Composition-Addressing-Settings-768x824.png 768w\" alt=\"Thunderbird Composition &amp; Addressing Settings\" width=\"816\" height=\"876\" aria-describedby=\"caption-attachment-25702\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25702\" class=\"wp-caption-text\">Thunderbird Composition &amp; Addressing Settings<\/p>\n<\/div>\n<p><strong>6.<\/strong>\u00a0The\u00a0<strong>LDAP Directory Servers<\/strong>\u00a0windows should open by now. Hit on\u00a0<strong>Add<\/strong>\u00a0button and fill\u00a0<strong>Directory Server Properties<\/strong>\u00a0windows with the following content:<\/p>\n<p>On\u00a0<strong>General<\/strong>\u00a0tab add descriptive name for this object, add the name of your domain or the FQDN of a Samba domain controller, the base DN of your domain in the form\u00a0<strong>dc=your_domain,dc=tld<\/strong>, LDAP port number 389 and the vmail Bind DN account used to query the Samba AD LDAP database in the form\u00a0<strong>vmail@your_domain.tld<\/strong>.<\/p>\n<p>Use the below screenshot as a guide.<\/p>\n<div id=\"attachment_25703\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Directory-Server-Properties.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25703\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Directory-Server-Properties.png\" alt=\"Directory Server Properties\" width=\"591\" height=\"399\" aria-describedby=\"caption-attachment-25703\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25703\" class=\"wp-caption-text\">Directory Server Properties<\/p>\n<\/div>\n<p><strong>7.<\/strong>\u00a0On the next step, move to\u00a0<strong>Advanced<\/strong>\u00a0tab from\u00a0<strong>Directory Server Properties<\/strong>, and add the following content in Search filter filed:<\/p>\n<pre>(&amp;(mail=*)(|(&amp;(objectClass=user)(!(objectClass=computer)))(objectClass=group)))\r\n<\/pre>\n<div id=\"attachment_25704\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Add-Search-Filter.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25704\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Add-Search-Filter.png\" alt=\"Add Search Filter\" width=\"582\" height=\"396\" aria-describedby=\"caption-attachment-25704\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25704\" class=\"wp-caption-text\">Add Search Filter<\/p>\n<\/div>\n<p>Leave the rest of the settings as default and hit on\u00a0<strong>OK<\/strong>\u00a0button to apply changes and again on\u00a0<strong>OK<\/strong>\u00a0button to close LDAP Directory Servers window and\u00a0<strong>OK<\/strong>\u00a0button again on\u00a0<strong>Account Settings<\/strong>\u00a0to close the window.<\/p>\n<div id=\"attachment_25705\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Select-LDAP-Directory-Server.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25705\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Select-LDAP-Directory-Server.png\" alt=\"Select LDAP Directory Server\" width=\"431\" height=\"405\" aria-describedby=\"caption-attachment-25705\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25705\" class=\"wp-caption-text\">Select LDAP Directory Server<\/p>\n<\/div>\n<p><strong>8.<\/strong>\u00a0To test if Thunderbird client can query Samba AD LDAP database for contacts, hit on the upper\u00a0<strong>Address Book<\/strong>icon, select the name of the LDAP database created earlier.<\/p>\n<p>Add the password for the Bind DN account configured to interrogate the AD LDAP server (<strong>vmail@your_domain.tld<\/strong>), check\u00a0<strong>Use Password Manager<\/strong>\u00a0to remember the password and hit\u00a0<strong>OK<\/strong>\u00a0button to reflect changes and close the window.<\/p>\n<div id=\"attachment_25706\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Samba-AD-LDAP-Testing.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25706\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Samba-AD-LDAP-Testing.png\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Samba-AD-LDAP-Testing.png 816w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Thunderbird-Samba-AD-LDAP-Testing-768x496.png 768w\" alt=\"Thunderbird Samba AD LDAP Testing\" width=\"816\" height=\"527\" aria-describedby=\"caption-attachment-25706\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25706\" class=\"wp-caption-text\">Thunderbird Samba AD LDAP Testing<\/p>\n<\/div>\n<p><strong>9.<\/strong>\u00a0Search for a Samba AD contact by using the upper search filed and suppling a domain account name. Be aware that Samba AD accounts with no e-mail address declared in their AD E-mail field will not be listed in Thunderbird Address Book searches.<\/p>\n<div id=\"attachment_25707\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Search-Samba-AD-Mail-Contacts.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25707\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Search-Samba-AD-Mail-Contacts.png\" alt=\"Search Samba AD Mail Contacts\" width=\"758\" height=\"357\" aria-describedby=\"caption-attachment-25707\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25707\" class=\"wp-caption-text\">Search Samba AD Mail Contacts<\/p>\n<\/div>\n<p><strong>10.<\/strong>\u00a0To search for a contact while composing an e-mail, click on\u00a0<strong>View \u2192 Contacts Sidebar<\/strong>\u00a0or press\u00a0<strong>F9<\/strong>\u00a0key to open Contacts panel.<\/p>\n<div id=\"attachment_25708\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Search-Mail-Contact-in-Thunderbird.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25708\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Search-Mail-Contact-in-Thunderbird.png\" alt=\"Search Mail Contacts in Thunderbird\" width=\"677\" height=\"432\" aria-describedby=\"caption-attachment-25708\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25708\" class=\"wp-caption-text\">Search Mail Contacts in Thunderbird<\/p>\n<\/div>\n<p><strong>11.<\/strong>\u00a0Select the proper Address Book and you should be able to search and add an e-mail address for your recipient. When sending the first mail, a new security alert window should appear. Hit on\u00a0<strong>Confirm Security Exception<\/strong>\u00a0and the mail should be sent to your recipient e-mail address.<\/p>\n<div id=\"attachment_25709\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Send-Mail-in-Thunderbird.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25709\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Send-Mail-in-Thunderbird.jpg\" sizes=\"auto, (max-width: 933px) 100vw, 933px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Send-Mail-in-Thunderbird.jpg 933w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Send-Mail-in-Thunderbird-768x480.jpg 768w\" alt=\"Send Mail in Thunderbird\" width=\"933\" height=\"583\" aria-describedby=\"caption-attachment-25709\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25709\" class=\"wp-caption-text\">Send Mail in Thunderbird<\/p>\n<\/div>\n<p><strong>12.<\/strong>\u00a0In case you want to search contacts through Samba LDAP database only for a specific AD Organizational Unit, edit the Address Book for your Directory Server name from the left plane, hit on\u00a0<strong>Properties<\/strong>\u00a0and add the custom Samba AD OU as illustrated on the below example.<\/p>\n<pre>ou=your_specific_ou,dc=your_domain,dc=tld \r\n<\/pre>\n<div id=\"attachment_25710\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Search-Contacts-in-Samba-LDAP-Database.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25710\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Search-Contacts-in-Samba-LDAP-Database.png\" alt=\"Search Contacts in Samba LDAP Database\" width=\"757\" height=\"451\" aria-describedby=\"caption-attachment-25710\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25710\" class=\"wp-caption-text\">Search Contacts in Samba LDAP Database<\/p>\n<\/div>\n<h3>Step 3: Setup LDAP Offline Replica<\/h3>\n<p><strong>13.<\/strong>\u00a0To configure Samba AD LDAP offline replica for Thunderbird hit on\u00a0<strong>Address Book<\/strong>\u00a0button, select your\u00a0<strong>LDAP Address Book<\/strong>, open\u00a0<strong>Directory Server Properties<\/strong>\u00a0-&gt;\u00a0<strong>General<\/strong>\u00a0tab and change the port number to 3268.<\/p>\n<p>Then switch to\u00a0<strong>Offline<\/strong>\u00a0tab and hit on\u00a0<strong>Download Now<\/strong>\u00a0button to start replicate Samba AD LDAP database locally.<\/p>\n<div id=\"attachment_25711\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Setup-LDAP-Offline-Replica-in-Thunderbird.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25711\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Setup-LDAP-Offline-Replica-in-Thunderbird.png\" alt=\"Setup LDAP Offline Replica in Thunderbird\" width=\"588\" height=\"398\" aria-describedby=\"caption-attachment-25711\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25711\" class=\"wp-caption-text\">Setup LDAP Offline Replica in Thunderbird<\/p>\n<\/div>\n<div id=\"attachment_25712\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Download-Samba-LDAP-Database-Offline.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25712\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/05\/Download-Samba-LDAP-Database-Offline.png\" alt=\"Download LDAP Database for Offline\" width=\"589\" height=\"398\" aria-describedby=\"caption-attachment-25712\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-25712\" class=\"wp-caption-text\">Download LDAP Database for Offline<\/p>\n<\/div>\n<p>When the process of synchronizing contacts finishes you will be informed with the message Replication succeeded. Hit\u00a0<strong>OK<\/strong>\u00a0and close all windows. In case Samba domain controller cannot be reached you can still search for LDAP contacts by working in offline mode.<\/p>\n<h1 class=\"post-title\">Integrate CentOS 7 to Samba4 AD from Commandline \u2013 Part 14<\/h1>\n<p>This guide will show you how you can integrate a\u00a0<strong>CentOS 7<\/strong>\u00a0Server with no Graphical User Interface\u00a0to\u00a0<a href=\"https:\/\/www.tecmint.com\/install-samba4-active-directory-ubuntu\/\" target=\"_blank\" rel=\"noopener\">Samba4 Active Directory Domain Controller<\/a>\u00a0from command line using Authconfig software.<\/p>\n<p>This type of setup provides a single centralized account database held by\u00a0Samba and allows the AD users to authenticate to CentOS server across the network infrastructure.<\/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 Active Directory Infrastructure with Samba4 on Ubuntu<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/centos-7-3-installation-guide\/\" target=\"_blank\" rel=\"noopener\">CentOS 7.3 Installation Guide<\/a><\/li>\n<\/ol>\n<h3>Step 1: Configure CentOS for Samba4 AD DC<\/h3>\n<p><strong>1.<\/strong>\u00a0Before starting to join\u00a0<strong>CentOS 7<\/strong>\u00a0Server into a\u00a0<strong>Samba4 DC<\/strong>\u00a0you need to assure that the network interface is properly configured to query domain via DNS service.<\/p>\n<p>Run\u00a0<a href=\"https:\/\/www.tecmint.com\/ip-command-examples\/\" target=\"_blank\" rel=\"noopener\">ip address<\/a>\u00a0command to list your machine network interfaces and choose the specific NIC to edit by issuing\u00a0<strong>nmtui-edit<\/strong>\u00a0command against the interface name, such as\u00a0<strong>ens33<\/strong>\u00a0in this example, as illustrated below.<\/p>\n<pre># ip address\r\n# nmtui-edit ens33\r\n<\/pre>\n<div id=\"attachment_26325\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Network-Interfaces.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26325\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Network-Interfaces.jpg\" sizes=\"auto, (max-width: 971px) 100vw, 971px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Network-Interfaces.jpg 971w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Network-Interfaces-768x342.jpg 768w\" alt=\"List Network Interfaces\" width=\"971\" height=\"432\" aria-describedby=\"caption-attachment-26325\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26325\" class=\"wp-caption-text\">List Network Interfaces<\/p>\n<\/div>\n<p><strong>2.<\/strong>\u00a0Once the network interface is opened for editing, add the static IPv4 configurations best suited for your LAN and make sure you setup Samba AD Domain Controllers IP addresses for the DNS servers.<\/p>\n<p>Also, append the name of your domain in search domains filed and navigate to\u00a0<strong>OK<\/strong>\u00a0button using\u00a0<strong>[TAB]<\/strong>\u00a0key to apply changes.<\/p>\n<p>The search domains filed assures that the domain counterpart is automatically appended by DNS resolution (FQDN) when you use only a short name for a domain DNS record.<\/p>\n<div id=\"attachment_26326\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Network-Interface.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26326\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Network-Interface.png\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Network-Interface.png 800w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Network-Interface-768x576.png 768w\" alt=\"Configure Network Interface\" width=\"800\" height=\"600\" aria-describedby=\"caption-attachment-26326\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26326\" class=\"wp-caption-text\">Configure Network Interface<\/p>\n<\/div>\n<p><strong>3.<\/strong>\u00a0Finally, restart the network daemon to apply changes and test if DNS resolution is properly configured by issuing series of\u00a0<strong>ping<\/strong>\u00a0commands against the domain name and domain controllers short names as shown below.<\/p>\n<pre># systemctl restart network.service\r\n# ping -c2 tecmint.lan\r\n# ping -c2 adc1\r\n# ping -c2 adc2\r\n<\/pre>\n<div id=\"attachment_26327\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Verify-DNS-Resolution-on-Domain.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26327\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Verify-DNS-Resolution-on-Domain.png\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Verify-DNS-Resolution-on-Domain.png 800w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Verify-DNS-Resolution-on-Domain-768x576.png 768w\" alt=\"Verify DNS Resolution on Domain\" width=\"800\" height=\"600\" aria-describedby=\"caption-attachment-26327\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26327\" class=\"wp-caption-text\">Verify DNS Resolution on Domain<\/p>\n<\/div>\n<p><strong>4.<\/strong>\u00a0Also, configure your machine\u00a0hostname and reboot the machine to properly apply the settings by issuing the following commands.<\/p>\n<pre># hostnamectl set-hostname your_hostname\r\n# init 6\r\n<\/pre>\n<p>Verify if hostname was correctly applied with the below commands.<\/p>\n<pre># cat \/etc\/hostname\r\n# hostname\r\n<\/pre>\n<p><strong>5.<\/strong>\u00a0Finally, sync local time with Samba4 AD DC by issuing the below commands with root privileges.<\/p>\n<pre># yum install ntpdate\r\n# ntpdate domain.tld\r\n<\/pre>\n<div id=\"attachment_26328\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Sync-Time-with-Samba4-AD-DC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26328\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Sync-Time-with-Samba4-AD-DC.png\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Sync-Time-with-Samba4-AD-DC.png 800w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Sync-Time-with-Samba4-AD-DC-768x576.png 768w\" alt=\"Sync Time with Samba4 AD DC\" width=\"800\" height=\"600\" aria-describedby=\"caption-attachment-26328\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26328\" class=\"wp-caption-text\">Sync Time with Samba4 AD DC<\/p>\n<\/div>\n<h3>Step 2: Join CentOS 7 Server to Samba4 AD DC<\/h3>\n<p><strong>6.<\/strong>\u00a0To join CentOS 7 server to Samba4 Active Directory, first install the following packages on your machine from an account with root privileges.<\/p>\n<pre># yum install authconfig samba-winbind samba-client samba-winbind-clients\r\n<\/pre>\n<p><strong>7.<\/strong>\u00a0In order to integrate CentOS 7 server to a domain controller run\u00a0<strong>authconfig-tui<\/strong>\u00a0graphical utility with root privileges and use the below configurations as described below.<\/p>\n<pre># authconfig-tui\r\n<\/pre>\n<p>At the first prompt screen choose:<\/p>\n<ul>\n<li>On\u00a0<strong>User Information<\/strong>:\n<ul>\n<li>Use Winbind<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>On\u00a0<strong>Authentication<\/strong>\u00a0tab select by pressing\u00a0<strong>[Space]<\/strong>\u00a0key:\n<ul>\n<li>Use\u00a0<strong>Shadow Password<\/strong><\/li>\n<li>Use\u00a0<strong>Winbind Authentication<\/strong><\/li>\n<li>Local authorization is sufficient<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div id=\"attachment_26329\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Authentication-Configuration.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26329\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Authentication-Configuration.png\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Authentication-Configuration.png 800w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Authentication-Configuration-768x576.png 768w\" alt=\"Authentication Configuration\" width=\"800\" height=\"600\" aria-describedby=\"caption-attachment-26329\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26329\" class=\"wp-caption-text\">Authentication Configuration<\/p>\n<\/div>\n<p><strong>8.<\/strong>\u00a0Hit\u00a0<strong>Next<\/strong>\u00a0to continue to the Winbind Settings screen and configure as illustrated below:<\/p>\n<ul>\n<li>Security Model:\u00a0<strong>ads<\/strong><\/li>\n<li>Domain\u00a0=\u00a0<strong>YOUR_DOMAIN<\/strong>\u00a0(use upper case)<\/li>\n<li>Domain Controllers =\u00a0<strong>domain machines FQDN<\/strong>\u00a0(comma separated if more than one)<\/li>\n<li>ADS Realm\u00a0=\u00a0<strong>YOUR_DOMAIN.TLD<\/strong><\/li>\n<li>Template Shell\u00a0=\u00a0<strong>\/bin\/bash<\/strong><\/li>\n<\/ul>\n<div id=\"attachment_26330\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Winbind-Settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26330\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Winbind-Settings.png\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Winbind-Settings.png 800w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Winbind-Settings-768x576.png 768w\" alt=\"Winbind Settings\" width=\"800\" height=\"600\" aria-describedby=\"caption-attachment-26330\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26330\" class=\"wp-caption-text\">Winbind Settings<\/p>\n<\/div>\n<p><strong>9.<\/strong>\u00a0To perform domain joining navigate to\u00a0<strong>Join Domain<\/strong>\u00a0button using\u00a0<strong>[tab]<\/strong>\u00a0key and hit\u00a0<strong>[Enter]<\/strong>\u00a0key to join domain.<\/p>\n<p>At the next screen prompt, add the credentials for a\u00a0<strong>Samba4 AD<\/strong>\u00a0account with elevated privileges to perform the machine account joining into AD and hit\u00a0<strong>OK<\/strong>\u00a0to apply settings and close the prompt.<\/p>\n<p>Be aware that when you type the user password, the credentials won\u2019t be shown in the password screen. On the remaining screen hit\u00a0<strong>OK<\/strong>\u00a0again to finish domain integration for CentOS 7 machine.<\/p>\n<div id=\"attachment_26331\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Join-Domain-to-Samba4-AD-DC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26331\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Join-Domain-to-Samba4-AD-DC.png\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Join-Domain-to-Samba4-AD-DC.png 800w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Join-Domain-to-Samba4-AD-DC-768x576.png 768w\" alt=\"Join Domain to Samba4 AD DC\" width=\"800\" height=\"600\" aria-describedby=\"caption-attachment-26331\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26331\" class=\"wp-caption-text\">Join Domain to Samba4 AD DC<\/p>\n<\/div>\n<div id=\"attachment_26332\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Confirm-Winbind-Settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26332\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Confirm-Winbind-Settings.png\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Confirm-Winbind-Settings.png 800w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Confirm-Winbind-Settings-768x576.png 768w\" alt=\"Confirm Winbind Settings\" width=\"800\" height=\"600\" aria-describedby=\"caption-attachment-26332\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26332\" class=\"wp-caption-text\">Confirm Winbind Settings<\/p>\n<\/div>\n<p>To force adding a machine into a specific\u00a0<strong>Samba AD Organizational Unit<\/strong>, get your machine exact name using hostname command and create a new Computer object in that OU with the name of your machine.<\/p>\n<p>The best way to add a new object into a Samba4 AD is by using\u00a0<strong>ADUC<\/strong>\u00a0tool from a Windows machine integrated into the domain with\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-ad-from-windows-via-rsat\/\" target=\"_blank\" rel=\"noopener\">RSAT tools installed<\/a>\u00a0on it.<\/p>\n<p><strong>Important<\/strong>: An alternate method of joining a domain is by using\u00a0<strong>authconfig<\/strong>\u00a0command line which offers extensive control over the integration process.<\/p>\n<p>However, this method is prone to errors do to its numerous parameters as illustrated on the below command excerpt. The command must be typed into a single long line.<\/p>\n<pre># authconfig --enablewinbind --enablewinbindauth --smbsecurity ads --smbworkgroup=YOUR_DOMAIN --smbrealm YOUR_DOMAIN.TLD --smbservers=adc1.yourdomain.tld --krb5realm=YOUR_DOMAIN.TLD --enablewinbindoffline --enablewinbindkrb5 --winbindtemplateshell=\/bin\/bash--winbindjoin=domain_admin_user --update  --enablelocauthorize   --savebackup=\/backups\r\n<\/pre>\n<p><strong>10.<\/strong>\u00a0After the machine has been joined to domain, verify if winbind service is up and running by issuing the below command.<\/p>\n<pre># systemctl status winbind.service\r\n<\/pre>\n<p><strong>11.<\/strong>\u00a0Then, check if CentOS machine object has been successfully created in Samba4 AD. Use AD Users and Computers\u00a0tool from a Windows machine with RSAT tools installed and navigate to your domain Computers container. A new AD computer account object with name of your CentOS 7 server should be listed in the right plane.<\/p>\n<p><strong>12.<\/strong>\u00a0Finally, tweak the configuration by opening samba main configuration file (<strong>\/etc\/samba\/smb.conf<\/strong>) with a text editor and append the below lines at the end of the\u00a0<strong>[global]<\/strong>\u00a0configuration block as illustrated below:<\/p>\n<pre>winbind use default domain = true\r\nwinbind offline logon = true\r\n<\/pre>\n<div id=\"attachment_26333\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Samba.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26333\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Samba.jpg\" sizes=\"auto, (max-width: 1067px) 100vw, 1067px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Samba.jpg 1067w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Samba-768x576.jpg 768w\" alt=\"Configure Samba\" width=\"1067\" height=\"800\" aria-describedby=\"caption-attachment-26333\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26333\" class=\"wp-caption-text\">Configure Samba<\/p>\n<\/div>\n<p><strong>13.<\/strong>\u00a0In order to create local homes on the machine for AD accounts at their first logon run the below command.<\/p>\n<pre># authconfig --enablemkhomedir --update\r\n<\/pre>\n<p><strong>14.<\/strong>\u00a0Finally, restart Samba daemon to reflect changes and verify domain joining by performing a logon on the server with an AD account. The home directory for the AD account should be automatically created.<\/p>\n<pre># systemctl restart winbind\r\n# su - domain_account\r\n<\/pre>\n<div id=\"attachment_26334\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Verify-Domain-Joining.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26334\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Verify-Domain-Joining.jpg\" sizes=\"auto, (max-width: 1067px) 100vw, 1067px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Verify-Domain-Joining.jpg 1067w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Verify-Domain-Joining-768x126.jpg 768w\" alt=\"Verify Domain Joining\" width=\"1067\" height=\"175\" aria-describedby=\"caption-attachment-26334\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26334\" class=\"wp-caption-text\">Verify Domain Joining<\/p>\n<\/div>\n<p><strong>15.<\/strong>\u00a0List the domain users or domain groups by issuing one of the following commands.<\/p>\n<pre># wbinfo -u\r\n# wbinfo -g\r\n<\/pre>\n<div id=\"attachment_26335\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Domain-Users-and-Groups.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26335\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Domain-Users-and-Groups.png\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Domain-Users-and-Groups.png 800w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Domain-Users-and-Groups-768x576.png 768w\" alt=\"List Domain Users and Groups\" width=\"800\" height=\"600\" aria-describedby=\"caption-attachment-26335\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26335\" class=\"wp-caption-text\">List Domain Users and Groups<\/p>\n<\/div>\n<p><strong>16.<\/strong>\u00a0To get info about a domain user run the below command.<\/p>\n<pre># wbinfo -i domain_user\r\n<\/pre>\n<div id=\"attachment_26336\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Domain-User-Info.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26336\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Domain-User-Info.jpg\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Domain-User-Info.jpg 900w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Domain-User-Info-768x187.jpg 768w\" alt=\"List Domain User Info\" width=\"900\" height=\"219\" aria-describedby=\"caption-attachment-26336\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26336\" class=\"wp-caption-text\">List Domain User Info<\/p>\n<\/div>\n<p><strong>17.<\/strong>\u00a0To display summary domain info issue the following command.<\/p>\n<pre># net ads info\r\n<\/pre>\n<div id=\"attachment_26337\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Domain-Summary.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26337\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Domain-Summary.jpg\" alt=\"List Domain Summary\" width=\"743\" height=\"411\" aria-describedby=\"caption-attachment-26337\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26337\" class=\"wp-caption-text\">List Domain Summary<\/p>\n<\/div>\n<h3>Step 3: Login to CentOS with a Samba4 AD DC Account<\/h3>\n<p><strong>18.<\/strong>\u00a0To authenticate with a domain user in CentOS, use one of the following command line syntaxes.<\/p>\n<pre># su - \u2018domain\\domain_user\u2019\r\n# su - domain\\domain_user\r\n<\/pre>\n<p>Or use the below syntax in case winbind use default domain = true parameter is set to samba configuration file.<\/p>\n<pre># su - domain_user\r\n# su - domain_user@domain.tld\r\n<\/pre>\n<p><strong>19.<\/strong>\u00a0In order to add root privileges for a domain user or group, edit\u00a0<strong>sudoers<\/strong>\u00a0file using\u00a0<strong>visudo<\/strong>\u00a0command and add the following lines as illustrated on the below screenshot.<\/p>\n<pre>YOUR_DOMAIN\\domain_username       \t\t ALL=(ALL:ALL) ALL  \t#For domain users\r\n%YOUR_DOMAIN\\your_domain\\  group       \t ALL=(ALL:ALL) ALL\t#For domain groups\r\n<\/pre>\n<p>Or use the below excerpt in case winbind use default domain = true parameter is set to samba configuration file.<\/p>\n<pre>domain_username \t        \t ALL=(ALL:ALL) ALL  \t#For domain users\r\n%your_domain\\  group       \t\t ALL=(ALL:ALL) ALL\t#For domain groups\r\n<\/pre>\n<div id=\"attachment_26338\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Grant-Root-Privileges-on-Domain-Users.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26338\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Grant-Root-Privileges-on-Domain-Users.jpg\" sizes=\"auto, (max-width: 1067px) 100vw, 1067px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Grant-Root-Privileges-on-Domain-Users.jpg 1067w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Grant-Root-Privileges-on-Domain-Users-768x576.jpg 768w\" alt=\"Grant Root Privileges on Domain Users\" width=\"1067\" height=\"800\" aria-describedby=\"caption-attachment-26338\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26338\" class=\"wp-caption-text\">Grant Root Privileges on Domain Users<\/p>\n<\/div>\n<p><strong>20.<\/strong>\u00a0The following series of commands against a Samba4 AD DC can also be useful for troubleshooting purposes:<\/p>\n<pre># wbinfo -p #Ping domain\r\n# wbinfo -n domain_account #Get the SID of a domain account\r\n# wbinfo -t  #Check trust relationship\r\n<\/pre>\n<p><strong>21.<\/strong>\u00a0To leave the domain run the following command against your domain name using a domain account with elevated privileges. After the machine account has been removed from the AD, reboot the machine to revert changes before the integration process.<\/p>\n<pre># net ads leave -w DOMAIN -U domain_admin\r\n# init 6\r\n<\/pre>\n<p>That\u2019s all! Although this procedure is mainly focused on joining a\u00a0CentOS 7\u00a0server to a Samba4 AD DC, the same steps described here are also valid for integrating a CentOS server into a Microsoft Windows Server 2012 Active Directory.<\/p>\n<h1 class=\"post-title\">Integrate Ubuntu to Samba4 AD DC with SSSD and Realm \u2013 Part 15<\/h1>\n<p>This tutorial will guide you on how to join an\u00a0<strong>Ubuntu Desktop<\/strong>\u00a0machine into a\u00a0<strong>Samba4 Active Directory<\/strong>\u00a0domain with\u00a0<strong>SSSD<\/strong>\u00a0and\u00a0<strong>Realmd<\/strong>\u00a0services in order to authenticate users against an Active Directory.<\/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 Active Directory Infrastructure with Samba4 on Ubuntu<\/a><\/li>\n<\/ol>\n<h3>Step 1: Initial Configurations<\/h3>\n<p><strong>1.<\/strong>\u00a0Before starting to join Ubuntu into an Active Directory make sure the hostname is properly configured. Use\u00a0<strong>hostnamectl<\/strong>\u00a0command to set the machine name or manually edit\u00a0<strong>\/etc\/hostname<\/strong>\u00a0file.<\/p>\n<pre>$ sudo hostnamectl set-hostname your_machine_short_hostname\r\n$ cat \/etc\/hostname\r\n$ hostnamectl\r\n<\/pre>\n<p><strong>2.<\/strong>\u00a0On the next step, edit machine network interface settings and add the proper IP configurations and the correct DNS IP server addresses to point to the Samba AD domain controller as illustrated in the below screenshot.<\/p>\n<p>If you have configured a DHCP server at your premises to automatically assign IP settings for your LAN machines with the proper AD DNS IP addresses then you can skip this step and move forward.<\/p>\n<div id=\"attachment_26355\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Network-Interface.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26355\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Network-Interface.jpg\" sizes=\"auto, (max-width: 1438px) 100vw, 1438px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Network-Interface.jpg 1438w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Network-Interface-768x381.jpg 768w\" alt=\"Configure Network Interface\" width=\"1438\" height=\"713\" aria-describedby=\"caption-attachment-26355\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26355\" class=\"wp-caption-text\">Configure Network Interface<\/p>\n<\/div>\n<p>On the above screenshot,\u00a0<strong>192.168.1.254<\/strong>\u00a0and\u00a0<strong>192.168.1.253<\/strong>\u00a0represents the IP addresses of the Samba4 Domain Controllers.<\/p>\n<p><strong>3.<\/strong>\u00a0Restart the network services to apply the changes using the GUI or from command line and issue a series of\u00a0<strong>ping command<\/strong>\u00a0against your domain name in order to test if DNS resolution is working as expected. Also, use\u00a0<strong>host<\/strong>\u00a0command to test DNS resolution.<\/p>\n<pre>$ sudo systemctl restart networking.service\r\n$ host your_domain.tld\r\n$ ping -c2 your_domain_name\r\n$ ping -c2 adc1\r\n$ ping -c2 adc2\r\n<\/pre>\n<p><strong>4.<\/strong>\u00a0Finally, make sure that machine time is in sync with Samba4 AD. Install\u00a0<strong>ntpdate<\/strong>\u00a0package and sync time with the AD by issuing the below commands.<\/p>\n<pre>$ sudo apt-get install ntpdate\r\n$ sudo ntpdate your_domain_name\r\n<\/pre>\n<h3>Step 2: Install Required Packages<\/h3>\n<p><strong>5.<\/strong>\u00a0On this step install the necessary software and required dependencies in order to join Ubuntu into Samba4 AD DC:\u00a0<strong>Realmd<\/strong>\u00a0and\u00a0<strong>SSSD<\/strong>\u00a0services.<\/p>\n<pre>$ sudo apt install adcli realmd krb5-user samba-common-bin samba-libs samba-dsdb-modules sssd sssd-tools libnss-sss libpam-sss packagekit policykit-1 \r\n<\/pre>\n<p><strong>6.<\/strong>\u00a0Enter the name of the default realm with uppercases and press\u00a0<strong>Enter<\/strong>\u00a0key to continue the installation.<\/p>\n<div id=\"attachment_26356\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Set-realm-name.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26356\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Set-realm-name.png\" sizes=\"auto, (max-width: 1072px) 100vw, 1072px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Set-realm-name.png 1072w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Set-realm-name-768x181.png 768w\" alt=\"Set Realm Name\" width=\"1072\" height=\"252\" aria-describedby=\"caption-attachment-26356\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26356\" class=\"wp-caption-text\">Set Realm Name<\/p>\n<\/div>\n<p><strong>7.<\/strong>\u00a0Next, create the\u00a0<strong>SSSD<\/strong>\u00a0configuration file with the following content.<\/p>\n<pre>$ sudo nano \/etc\/sssd\/sssd.conf\r\n<\/pre>\n<p>Add following lines to\u00a0<strong>sssd.conf<\/strong>\u00a0file.<\/p>\n<pre>[nss]\r\nfilter_groups = root\r\nfilter_users = root\r\nreconnection_retries = 3\r\n\r\n[pam]\r\nreconnection_retries = 3\r\n\r\n[sssd]\r\ndomains = tecmint.lan\r\nconfig_file_version = 2\r\nservices = nss, pam\r\ndefault_domain_suffix = TECMINT.LAN\r\n\r\n\r\n[domain\/tecmint.lan]\r\nad_domain = tecmint.lan\r\nkrb5_realm = TECMINT.LAN\r\nrealmd_tags = manages-system joined-with-samba\r\ncache_credentials = True\r\nid_provider = ad\r\nkrb5_store_password_if_offline = True\r\ndefault_shell = \/bin\/bash\r\nldap_id_mapping = True\r\nuse_fully_qualified_names = True\r\nfallback_homedir = \/home\/%d\/%u\r\naccess_provider = ad\r\n\r\nauth_provider = ad\r\nchpass_provider = ad\r\naccess_provider = ad\r\nldap_schema = ad\r\ndyndns_update = true\r\ndyndns_refresh_interval = 43200\r\ndyndns_update_ptr = true\r\ndyndns_ttl = 3600\r\n<\/pre>\n<p>Make sure you replace the domain name in following parameters accordingly:<\/p>\n<pre>domains = tecmint.lan\r\ndefault_domain_suffix = TECMINT.LAN\r\n[domain\/tecmint.lan]\r\nad_domain = tecmint.lan\r\nkrb5_realm = TECMINT.LAN\r\n<\/pre>\n<p><strong>8.<\/strong>\u00a0Next, add the proper permissions for SSSD file by issuing the below command:<\/p>\n<pre>$ sudo chmod 700 \/etc\/sssd\/sssd.conf\r\n<\/pre>\n<p><strong>9.<\/strong>\u00a0Now, open and edit\u00a0<strong>Realmd<\/strong>\u00a0configuration file and add the following lines.<\/p>\n<pre>$ sudo nano \/etc\/realmd.conf\r\n<\/pre>\n<p><strong>Realmd.conf<\/strong>\u00a0file excerpt:<\/p>\n<pre>[active-directory]\r\nos-name = Linux Ubuntu\r\nos-version = 17.04\r\n\r\n[service]\r\nautomatic-install = yes\r\n\r\n [users]\r\ndefault-home = \/home\/%d\/%u\r\ndefault-shell = \/bin\/bash\r\n\r\n[tecmint.lan]\r\nuser-principal = yes\r\nfully-qualified-names = no\r\n<\/pre>\n<p><strong>10.<\/strong>\u00a0The last file you need to modify belongs to Samba daemon. Open\u00a0<strong>\/etc\/samba\/smb.conf<\/strong>\u00a0file for editing and add the following block of code at the beginning of the file, after the\u00a0<strong>[global]<\/strong>\u00a0section as illustrated on the image below.<\/p>\n<pre> workgroup = TECMINT\r\n   client signing = yes\r\n   client use spnego = yes\r\n   kerberos method = secrets and keytab\r\n   realm = TECMINT.LAN\r\n   security = ads\r\n<\/pre>\n<div id=\"attachment_26357\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Samba-Server.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26357\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Samba-Server.jpg\" sizes=\"auto, (max-width: 1239px) 100vw, 1239px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Samba-Server.jpg 1239w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Configure-Samba-Server-768x615.jpg 768w\" alt=\"Configure Samba Server\" width=\"1239\" height=\"992\" aria-describedby=\"caption-attachment-26357\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26357\" class=\"wp-caption-text\">Configure Samba Server<\/p>\n<\/div>\n<p>Make sure you replace the\u00a0<strong>domain name<\/strong>\u00a0value, especially the\u00a0<strong>realm value<\/strong>\u00a0to match your domain name and run\u00a0<strong>testparm<\/strong>\u00a0command in order to check if the configuration file contains no errors.<\/p>\n<pre>$ sudo testparm\r\n<\/pre>\n<div id=\"attachment_26358\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Test-Samba-Configuration.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26358\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Test-Samba-Configuration.jpg\" sizes=\"auto, (max-width: 909px) 100vw, 909px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Test-Samba-Configuration.jpg 909w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Test-Samba-Configuration-768x440.jpg 768w\" alt=\"Test Samba Configuration\" width=\"909\" height=\"521\" aria-describedby=\"caption-attachment-26358\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26358\" class=\"wp-caption-text\">Test Samba Configuration<\/p>\n<\/div>\n<p><strong>11.<\/strong>\u00a0After you\u2019ve made all the required changes, test Kerberos authentication using an AD administrative account and list the ticket by issuing the below commands.<\/p>\n<pre>$ sudo kinit ad_admin_user@DOMAIN.TLD\r\n$ sudo klist\r\n<\/pre>\n<div id=\"attachment_26359\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Check-Kerberos-Authentication.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26359\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Check-Kerberos-Authentication.jpg\" sizes=\"auto, (max-width: 995px) 100vw, 995px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Check-Kerberos-Authentication.jpg 995w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Check-Kerberos-Authentication-768x353.jpg 768w\" alt=\"Check Kerberos Authentication\" width=\"995\" height=\"457\" aria-describedby=\"caption-attachment-26359\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26359\" class=\"wp-caption-text\">Check Kerberos Authentication<\/p>\n<\/div>\n<h3>Step 3: Join Ubuntu to Samba4 Realm<\/h3>\n<p><strong>12.<\/strong>\u00a0To join Ubuntu machine to Samba4 Active Directory issue following series of commands as illustrated below. Use the name of an AD DC account with administrator privileges in order for the binding to realm to work as expected and replace the domain name value accordingly.<\/p>\n<pre>$ sudo realm discover -v DOMAIN.TLD\r\n$ sudo realm list\r\n$ sudo realm join TECMINT.LAN -U ad_admin_user -v\r\n$ sudo net ads join -k\r\n<\/pre>\n<div id=\"attachment_26360\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Join-Ubuntu-to-Samba4-Realm.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26360\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Join-Ubuntu-to-Samba4-Realm.jpg\" sizes=\"auto, (max-width: 801px) 100vw, 801px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Join-Ubuntu-to-Samba4-Realm.jpg 801w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Join-Ubuntu-to-Samba4-Realm-768x561.jpg 768w\" alt=\"Join Ubuntu to Samba4 Realm\" width=\"801\" height=\"585\" aria-describedby=\"caption-attachment-26360\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26360\" class=\"wp-caption-text\">Join Ubuntu to Samba4 Realm<\/p>\n<\/div>\n<div id=\"attachment_26362\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Realm-Domain-Info.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26362\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Realm-Domain-Info.jpg\" alt=\"List Realm Domain Info\" width=\"623\" height=\"844\" aria-describedby=\"caption-attachment-26362\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26362\" class=\"wp-caption-text\">List Realm Domain Info<\/p>\n<\/div>\n<div id=\"attachment_26361\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Add-User-to-Realm-Domain.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26361\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Add-User-to-Realm-Domain.jpg\" sizes=\"auto, (max-width: 903px) 100vw, 903px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Add-User-to-Realm-Domain.jpg 903w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Add-User-to-Realm-Domain-768x303.jpg 768w\" alt=\"Add User to Realm Domain\" width=\"903\" height=\"356\" aria-describedby=\"caption-attachment-26361\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26361\" class=\"wp-caption-text\">Add User to Realm Domain<\/p>\n<\/div>\n<div id=\"attachment_26363\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Add-Domain-to-Realm.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26363\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Add-Domain-to-Realm.jpg\" sizes=\"auto, (max-width: 924px) 100vw, 924px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Add-Domain-to-Realm.jpg 924w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Add-Domain-to-Realm-768x199.jpg 768w\" alt=\"List Realm Domain Info\" width=\"924\" height=\"239\" aria-describedby=\"caption-attachment-26363\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26363\" class=\"wp-caption-text\">Add Domain to Realm<\/p>\n<\/div>\n<p><strong>13.<\/strong>\u00a0After the domain binding took place, run the below command to assure that all domain accounts are permitted to authenticate on the machine.<\/p>\n<pre>$ sudo realm permit --all\r\n<\/pre>\n<p>Subsequently, you can allow or deny access for a domain user account or a group using realm command as presented on the below examples.<\/p>\n<pre>$ sudo realm deny -a\r\n$ realm permit --groups \u2018domain.tld\\Linux Admins\u2019\r\n$ realm permit user@domain.lan\r\n$ realm permit DOMAIN\\User2\r\n<\/pre>\n<p><strong>14.<\/strong>\u00a0From a Windows machine with\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-ad-from-windows-via-rsat\/\" target=\"_blank\" rel=\"noopener\">RSAT tools installed<\/a>\u00a0you can open\u00a0<strong>AD UC<\/strong>\u00a0and navigate to\u00a0<strong>Computers<\/strong>container and check if an object account with the name of your machine has been created.<\/p>\n<div id=\"attachment_26364\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Confirm-Domain-Added.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26364\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Confirm-Domain-Added.jpg\" sizes=\"auto, (max-width: 983px) 100vw, 983px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Confirm-Domain-Added.jpg 983w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Confirm-Domain-Added-768x470.jpg 768w\" alt=\"Confirm Domain Added to AD DC\" width=\"983\" height=\"601\" aria-describedby=\"caption-attachment-26364\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26364\" class=\"wp-caption-text\">Confirm Domain Added to AD DC<\/p>\n<\/div>\n<h3>Step 4: Configure AD Accounts Authentication<\/h3>\n<p><strong>15.<\/strong>\u00a0In order to authenticate on Ubuntu machine with domain accounts you need to run\u00a0<strong>pam-auth-update<\/strong>command with root privileges and enable all PAM profiles including the option to automatically create home directories for each domain account at the first login.<\/p>\n<p>Check all entries by pressing\u00a0<strong>[space]<\/strong>\u00a0key and hit\u00a0<strong>ok<\/strong>\u00a0to apply configuration.<\/p>\n<pre>$ sudo pam-auth-update\r\n<\/pre>\n<div id=\"attachment_26365\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/PAM-Configuration.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26365\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/PAM-Configuration.jpg\" sizes=\"auto, (max-width: 1409px) 100vw, 1409px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/PAM-Configuration.jpg 1409w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/PAM-Configuration-768x491.jpg 768w\" alt=\"PAM Configuration\" width=\"1409\" height=\"900\" aria-describedby=\"caption-attachment-26365\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26365\" class=\"wp-caption-text\">PAM Configuration<\/p>\n<\/div>\n<p><strong>16.<\/strong>\u00a0On systems manually edit\u00a0<strong>\/etc\/pam.d\/common-account<\/strong>\u00a0file and the following line in order to automatically create homes for authenticated domain users.<\/p>\n<pre>session    required    pam_mkhomedir.so    skel=\/etc\/skel\/    umask=0022\r\n<\/pre>\n<p><strong>17.<\/strong>\u00a0If Active Directory users can\u2019t change their password from command line in Linux, open\u00a0<strong>\/etc\/pam.d\/common-password<\/strong>\u00a0file and remove the\u00a0<strong>use_authtok<\/strong>\u00a0statement from password line to finally look as on the below excerpt.<\/p>\n<pre>password       [success=1 default=ignore]      pam_winbind.so try_first_pass\r\n<\/pre>\n<p><strong>18.<\/strong>\u00a0Finally, restart and enable Realmd and SSSD service to apply changes by issuing the below commands:<\/p>\n<pre>$ sudo systemctl restart realmd sssd\r\n$ sudo systemctl enable realmd sssd\r\n<\/pre>\n<p><strong>19.<\/strong>\u00a0In order to test if the Ubuntu machine was successfully integrated to realm run install winbind package and run\u00a0<strong>wbinfo<\/strong>\u00a0command to list domain accounts and groups as illustrated below.<\/p>\n<pre>$ sudo apt-get install winbind\r\n$ wbinfo -u\r\n$ wbinfo -g\r\n<\/pre>\n<div id=\"attachment_26366\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Domain-Accounts.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26366\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/List-Domain-Accounts.jpg\" alt=\"List Domain Accounts\" width=\"659\" height=\"653\" aria-describedby=\"caption-attachment-26366\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26366\" class=\"wp-caption-text\">List Domain Accounts<\/p>\n<\/div>\n<p><strong>20.<\/strong>\u00a0Also, check Winbind nsswitch module by issuing the\u00a0<strong>getent<\/strong>\u00a0command against a specific domain user or group.<\/p>\n<pre>$ sudo getent passwd your_domain_user\r\n$ sudo getent group \u2018domain admins\u2019\r\n<\/pre>\n<div id=\"attachment_26367\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/check-Winbind-nsswitch.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26367\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/check-Winbind-nsswitch.jpg\" sizes=\"auto, (max-width: 1248px) 100vw, 1248px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/check-Winbind-nsswitch.jpg 1248w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/check-Winbind-nsswitch-768x220.jpg 768w\" alt=\"Check Winbind Nsswitch\" width=\"1248\" height=\"357\" aria-describedby=\"caption-attachment-26367\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26367\" class=\"wp-caption-text\">Check Winbind Nsswitch<\/p>\n<\/div>\n<p><strong>21.<\/strong>\u00a0You can also use Linux\u00a0<strong>id<\/strong>\u00a0command to get info about an AD account as illustrated on the below command.<\/p>\n<pre>$ id tecmint_user\r\n<\/pre>\n<div id=\"attachment_26368\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Check-AD-User-Info.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26368\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Check-AD-User-Info.jpg\" sizes=\"auto, (max-width: 1718px) 100vw, 1718px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Check-AD-User-Info.jpg 1718w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Check-AD-User-Info-768x352.jpg 768w\" alt=\"Check AD User Info\" width=\"1718\" height=\"788\" aria-describedby=\"caption-attachment-26368\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26368\" class=\"wp-caption-text\">Check AD User Info<\/p>\n<\/div>\n<p><strong>22.<\/strong>\u00a0To authenticate on Ubuntu host with a Samba4 AD account use the domain username parameter after\u00a0<strong>su<\/strong>\u00a0\u2013 command. Run\u00a0<strong>id<\/strong>\u00a0command to get extra info about the AD account.<\/p>\n<pre>$ su - your_ad_user\r\n<\/pre>\n<div id=\"attachment_26369\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/AD-User-Authentication.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26369\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/AD-User-Authentication.jpg\" sizes=\"auto, (max-width: 1041px) 100vw, 1041px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/AD-User-Authentication.jpg 1041w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/AD-User-Authentication-768x336.jpg 768w\" alt=\"AD User Authentication\" width=\"1041\" height=\"455\" aria-describedby=\"caption-attachment-26369\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26369\" class=\"wp-caption-text\">AD User Authentication<\/p>\n<\/div>\n<p>Use\u00a0<strong>pwd<\/strong>\u00a0command to see your domain user current working directory and passwd command if you want to change password.<\/p>\n<p><strong>23.<\/strong>\u00a0To use a domain account with root privileges on your Ubuntu machine, you need to add the AD username to the sudo system group by issuing the below command:<\/p>\n<pre>$ sudo usermod -aG sudo your_domain_user@domain.tld\r\n<\/pre>\n<p>Login to Ubuntu with the domain account and update your system by running\u00a0<strong>apt update<\/strong>\u00a0command to check root privileges.<\/p>\n<p><strong>24.<\/strong>\u00a0To add root privileges for a domain group, open end edit\u00a0<strong>\/etc\/sudoers<\/strong>\u00a0file using\u00a0<strong>visudo<\/strong>\u00a0command and add the following line as illustrated.<\/p>\n<pre>%domain\\ admins@tecmint.lan       \t\t ALL=(ALL:ALL) ALL\r\n<\/pre>\n<p><strong>25.<\/strong>\u00a0To use domain account authentication for Ubuntu Desktop modify\u00a0<strong>LightDM<\/strong>\u00a0display manager by editing\u00a0<strong>\/usr\/share\/lightdm\/lightdm.conf.d\/50-ubuntu.conf<\/strong>\u00a0file, append the following two lines and restart lightdm service or reboot the machine apply changes.<\/p>\n<pre>greeter-show-manual-login=true\r\ngreeter-hide-users=true\r\n<\/pre>\n<p>Log in to Ubuntu Desktop with a domain account using either\u00a0<strong>your_domain_username<\/strong>\u00a0or\u00a0<strong>your_domain_username@your_domain.tld<\/strong>\u00a0syntax.<\/p>\n<p><strong>26.<\/strong>\u00a0To use short name format for Samba AD accounts, edit\u00a0<strong>\/etc\/sssd\/sssd.conf<\/strong>\u00a0file, add the following line in\u00a0<strong>[sssd]<\/strong>\u00a0block as illustrated below.<\/p>\n<pre>full_name_format = %1$s\r\n<\/pre>\n<p>and restart SSSD daemon to apply changes.<\/p>\n<pre>$ sudo systemctl restart sssd\r\n<\/pre>\n<p>You will notice that the bash prompt will change to the short name of the AD user without appending the domain name counterpart.<\/p>\n<p><strong>27.<\/strong>\u00a0In case you cannot login due to\u00a0<strong>enumerate=true<\/strong>\u00a0argument set in\u00a0<strong>sssd.conf<\/strong>\u00a0you must clear sssd cached database by issuing the below command:<\/p>\n<pre>$ rm \/var\/lib\/sss\/db\/cache_tecmint.lan.ldb\r\n<\/pre>\n<p>That\u2019s all! Although this guide is mainly focused on integration with a Samba4 Active Directory, the same steps can be applied in order to integrate Ubuntu with Realmd and SSSD services into a Microsoft Windows Server Active Directory.<\/p>\n<h1 class=\"post-title\">Integrate VMware ESXI to Samba4 AD Domain Controller \u2013 Part 16<\/h1>\n<p>This guide will describe how to integrate a\u00a0<strong>VMware ESXI<\/strong>\u00a0host into a\u00a0<strong>Samba4 Active Directory Domain Controller<\/strong>in order to authenticate in\u00a0<strong>VMware vSphere Hypervisors<\/strong>\u00a0across network infrastructure with accounts provided by a single centralized database.<\/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 Active Directory Infrastructure with Samba4 on Ubuntu<\/a><\/li>\n<\/ol>\n<h3>Step 1: Configure VMware ESXI Network for Samba4 AD DC<\/h3>\n<p><strong>1.<\/strong>\u00a0Preliminary steps before joining a\u00a0<strong>VMware ESXI<\/strong>\u00a0to a\u00a0<strong>Samba4<\/strong>\u00a0require that the hypervisor has the proper\u00a0<strong>Samba4 AD IP<\/strong>\u00a0addresses configured in order to query the domain via DNS service.<\/p>\n<p>To accomplish this step from\u00a0<strong>VMware ESXI<\/strong>\u00a0direct console, reboot the hypervisor, press\u00a0<code>F2<\/code>\u00a0to open the direct console (also called\u00a0<strong>DCUI<\/strong>) and authenticate with the root credentials assigned for the host.<\/p>\n<p>Then, using the keyboard arrows navigate to\u00a0<strong>Configure Management Network<\/strong>\u00a0-&gt;\u00a0<strong>DNS Configuration<\/strong>\u00a0and add the IP addresses of your Samba4 Domain Controllers in Primary and Alternate DNS Server fields.<\/p>\n<p>Also, configure the hostname for the hypervisor with a descriptive name and press\u00a0<strong>[Enter]<\/strong>\u00a0to apply changes. Use the below screenshots as a guide.<\/p>\n<div id=\"attachment_26483\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Console.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26483\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Console.jpg\" sizes=\"auto, (max-width: 1012px) 100vw, 1012px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Console.jpg 1012w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Console-768x389.jpg 768w\" alt=\"VMware ESXI Console\" width=\"1012\" height=\"513\" aria-describedby=\"caption-attachment-26483\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26483\" class=\"wp-caption-text\">VMware ESXI Console<\/p>\n<\/div>\n<div id=\"attachment_26485\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMwar-ESXI-DNS-Configuration.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26485\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMwar-ESXI-DNS-Configuration.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMwar-ESXI-DNS-Configuration.png 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMwar-ESXI-DNS-Configuration-768x576.png 768w\" alt=\"VMware ESXI DNS Configuration\" width=\"1024\" height=\"768\" aria-describedby=\"caption-attachment-26485\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26485\" class=\"wp-caption-text\">VMware ESXI DNS Configuration<\/p>\n<\/div>\n<div id=\"attachment_26484\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Set-Hostname.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26484\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Set-Hostname.jpg\" sizes=\"auto, (max-width: 1365px) 100vw, 1365px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Set-Hostname.jpg 1365w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Set-Hostname-768x436.jpg 768w\" alt=\"VMware ESXI Set Hostname\" width=\"1365\" height=\"775\" aria-describedby=\"caption-attachment-26484\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26484\" class=\"wp-caption-text\">VMware ESXI Set Hostname<\/p>\n<\/div>\n<p><strong>2.<\/strong>\u00a0Next, go to\u00a0<strong>Custom DNS Suffixes<\/strong>, add the name of your domain and press\u00a0<strong>[Enter]<\/strong>\u00a0key to write changes and return to main menu.<\/p>\n<p>Then, go to\u00a0<strong>Restart Management Network<\/strong>\u00a0and press\u00a0<strong>[Enter]<\/strong>\u00a0key restart the network service in order to apply all changes made so far.<\/p>\n<div id=\"attachment_26487\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Custom-DNS-Suffix.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26487\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Custom-DNS-Suffix.jpg\" sizes=\"auto, (max-width: 1233px) 100vw, 1233px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Custom-DNS-Suffix.jpg 1233w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Custom-DNS-Suffix-768x413.jpg 768w\" alt=\"VMware ESXI Custom DNS Suffix\" width=\"1233\" height=\"663\" aria-describedby=\"caption-attachment-26487\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26487\" class=\"wp-caption-text\">VMware ESXI Custom DNS Suffix<\/p>\n<\/div>\n<div id=\"attachment_26486\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Network-Management.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26486\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Network-Management.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Network-Management.png 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Network-Management-768x576.png 768w\" alt=\"VMware ESXI Network Management\" width=\"1024\" height=\"768\" aria-describedby=\"caption-attachment-26486\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26486\" class=\"wp-caption-text\">VMware ESXI Network Management<\/p>\n<\/div>\n<p><strong>3.<\/strong>\u00a0Finally, make sure that gateway and\u00a0<strong>Samba DNS IPs<\/strong>\u00a0are reachable from the hypervisor and test if the DNS resolution works as expected by selecting\u00a0<strong>Test Management Network<\/strong>\u00a0from the menu.<\/p>\n<div id=\"attachment_26490\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Test-Management-Network.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26490\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Test-Management-Network.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Test-Management-Network.png 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-ESXI-Test-Management-Network-768x576.png 768w\" alt=\"VMware ESXI Test Management Network\" width=\"1024\" height=\"768\" aria-describedby=\"caption-attachment-26490\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26490\" class=\"wp-caption-text\">VMware ESXI Test Management Network<\/p>\n<\/div>\n<div id=\"attachment_26489\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Test-Samba-DNS-IP.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26489\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Test-Samba-DNS-IP.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Test-Samba-DNS-IP.png 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Test-Samba-DNS-IP-768x576.png 768w\" alt=\"Test Samba DNS IP\" width=\"1024\" height=\"768\" aria-describedby=\"caption-attachment-26489\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26489\" class=\"wp-caption-text\">Test Samba DNS IP<\/p>\n<\/div>\n<div id=\"attachment_26488\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Confirm-Samba-DNS-IP.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26488\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Confirm-Samba-DNS-IP.jpg\" sizes=\"auto, (max-width: 1168px) 100vw, 1168px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Confirm-Samba-DNS-IP.jpg 1168w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Confirm-Samba-DNS-IP-768x481.jpg 768w\" alt=\"Confirm Samba DNS IP\" width=\"1168\" height=\"731\" aria-describedby=\"caption-attachment-26488\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26488\" class=\"wp-caption-text\">Confirm Samba DNS IP<\/p>\n<\/div>\n<h3>Step 2: Join VMware ESXI to Samba4 AD DC<\/h3>\n<p><strong>4.<\/strong>\u00a0All the steps performed from now on will be made through the\u00a0<strong>VMware vSphere Client<\/strong>. Open\u00a0<strong>VMware vSphere Client<\/strong>\u00a0and login to your hypervisor IP address with the default root account credentials or with other account with root privileges on the hypervisor if that\u2019s the case.<\/p>\n<div id=\"attachment_26491\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-vSphere-Client.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26491\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-vSphere-Client.jpg\" alt=\"VMware vSphere Client\" width=\"569\" height=\"629\" aria-describedby=\"caption-attachment-26491\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26491\" class=\"wp-caption-text\">VMware vSphere Client<\/p>\n<\/div>\n<p><strong>5.<\/strong>\u00a0Once you\u2019ve entered the\u00a0<strong>vSphere console<\/strong>, before actually joining to the domain, make sure that the hypervisor\u2019s time is in sync with Samba domain controllers.<\/p>\n<p>To accomplish this, navigate to the upper menu and hit on\u00a0<strong>Configuration<\/strong>\u00a0tab. Then, go to left box\u00a0<strong>Software<\/strong>\u00a0-&gt;\u00a0<strong>Time Configuration<\/strong>\u00a0and hit\u00a0<strong>Properties<\/strong>\u00a0button from upper right plane and the\u00a0<strong>Time Configuration<\/strong>\u00a0window should open as illustrated below.<\/p>\n<div id=\"attachment_26492\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-vSphere-Client-Time-Configuration.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26492\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-vSphere-Client-Time-Configuration.png\" sizes=\"auto, (max-width: 1784px) 100vw, 1784px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-vSphere-Client-Time-Configuration.png 1784w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-vSphere-Client-Time-Configuration-768x360.png 768w\" alt=\"VMware vSphere Client Time Configuration\" width=\"1784\" height=\"837\" aria-describedby=\"caption-attachment-26492\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26492\" class=\"wp-caption-text\">VMware vSphere Client Time Configuration<\/p>\n<\/div>\n<p><strong>6.<\/strong>\u00a0On\u00a0<strong>Time Configuration<\/strong>\u00a0window hit on\u00a0<strong>Options<\/strong>\u00a0button, navigate to\u00a0<strong>NTP Settings<\/strong>\u00a0and add the IP addresses of your domain time providers (usually the IP addresses of your Samba domain controllers).<\/p>\n<p>Then go to\u00a0<strong>General<\/strong>\u00a0menu and start the\u00a0<strong>NTP<\/strong>\u00a0daemon and choose to start and stop the NTP service with the hypervisor as illustrated below. Press\u00a0<strong>OK<\/strong>\u00a0button to apply changes and close both windows.<\/p>\n<div id=\"attachment_26494\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Add-NTP-Server-IP.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26494\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Add-NTP-Server-IP.jpg\" sizes=\"auto, (max-width: 888px) 100vw, 888px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Add-NTP-Server-IP.jpg 888w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Add-NTP-Server-IP-768x471.jpg 768w\" alt=\"Add NTP Server IP\" width=\"888\" height=\"545\" aria-describedby=\"caption-attachment-26494\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26494\" class=\"wp-caption-text\">Add NTP Server IP<\/p>\n<\/div>\n<div id=\"attachment_26493\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Manage-NTP-Service.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26493\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Manage-NTP-Service.jpg\" sizes=\"auto, (max-width: 908px) 100vw, 908px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Manage-NTP-Service.jpg 908w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Manage-NTP-Service-768x484.jpg 768w\" alt=\"Manage NTP Service\" width=\"908\" height=\"572\" aria-describedby=\"caption-attachment-26493\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26493\" class=\"wp-caption-text\">Manage NTP Service<\/p>\n<\/div>\n<p><strong>7.<\/strong>\u00a0Now you can join\u00a0<strong>VMware ESXI<\/strong>\u00a0hypervisor to Samba domain. Open\u00a0<strong>Directory Services Configuration<\/strong>\u00a0window by hitting on\u00a0<strong>Configuration<\/strong>\u00a0-&gt;\u00a0<strong>Authentication Services<\/strong>\u00a0\u2013&gt;\u00a0<strong>Properties<\/strong>.<\/p>\n<p>From the window prompt select\u00a0<strong>Active Directory<\/strong>\u00a0as\u00a0<strong>Directory Service Type<\/strong>, write the name of your domain with uppercase click on\u00a0<strong>Join Domain<\/strong>\u00a0button to perform the domain binding.<\/p>\n<p>On the new prompt you will be asked to add the credentials of a domain account with elevated privileges to perform the joining. Add the username and password of a domain account with administrative privileges and hit\u00a0<strong>Join Domain<\/strong>\u00a0button to integrate into the realm and\u00a0<strong>OK<\/strong>\u00a0button to close the window.<\/p>\n<div id=\"attachment_26496\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Join-VMware-ESXI-Hypervisor-to-Samba.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26496\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Join-VMware-ESXI-Hypervisor-to-Samba.png\" sizes=\"auto, (max-width: 1504px) 100vw, 1504px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Join-VMware-ESXI-Hypervisor-to-Samba.png 1504w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Join-VMware-ESXI-Hypervisor-to-Samba-768x392.png 768w\" alt=\"Join VMware ESXI Hypervisor to Samba\" width=\"1504\" height=\"768\" aria-describedby=\"caption-attachment-26496\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26496\" class=\"wp-caption-text\">Join VMware ESXI Hypervisor to Samba<\/p>\n<\/div>\n<div id=\"attachment_26495\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Directory-Services-Configuration.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26495\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Directory-Services-Configuration.jpg\" alt=\"Directory Services Configuration\" width=\"673\" height=\"551\" aria-describedby=\"caption-attachment-26495\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26495\" class=\"wp-caption-text\">Directory Services Configuration<\/p>\n<\/div>\n<p><strong>8.<\/strong>\u00a0In order to verify if the\u00a0<strong>ESXI hypervisor<\/strong>\u00a0has been integrated to\u00a0<strong>Samba4 AD DC<\/strong>, open\u00a0<strong>AD Users and Computers<\/strong>from a\u00a0<a href=\"https:\/\/www.tecmint.com\/manage-samba4-ad-from-windows-via-rsat\/\" target=\"_blank\" rel=\"noopener\">Windows machine with RSAT tools installed<\/a>\u00a0and navigate to your domain Computers container.<\/p>\n<p>The hostname of\u00a0<strong>VMware ESXI<\/strong>\u00a0machine should be listed on the right plane as illustrated below.<\/p>\n<div id=\"attachment_26497\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/AD-Users-and-Computers.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26497\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/AD-Users-and-Computers.jpg\" sizes=\"auto, (max-width: 1003px) 100vw, 1003px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/AD-Users-and-Computers.jpg 1003w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/AD-Users-and-Computers-768x448.jpg 768w\" alt=\"AD Users and Computers\" width=\"1003\" height=\"585\" aria-describedby=\"caption-attachment-26497\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26497\" class=\"wp-caption-text\">AD Users and Computers<\/p>\n<\/div>\n<h3>Step 3: Assign Permissions for Domain Accounts to ESXI Hypervisor<\/h3>\n<p><strong>9.<\/strong>\u00a0In order to manipulate different aspects and services of the VMware hypervisor you might want to assign certain permissions and roles for domain accounts in VMware ESXI host.<\/p>\n<p>To add permissions hit on upper\u00a0<strong>Permissions<\/strong>\u00a0tab, right-click anywhere in the permissions plane and choose\u00a0<strong>Add Permission<\/strong>\u00a0from the menu.<\/p>\n<div id=\"attachment_26498\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Assign-Permissions-for-Domain-Accounts.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26498\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Assign-Permissions-for-Domain-Accounts.jpg\" sizes=\"auto, (max-width: 1004px) 100vw, 1004px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Assign-Permissions-for-Domain-Accounts.jpg 1004w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Assign-Permissions-for-Domain-Accounts-768x414.jpg 768w\" alt=\"Assign Permissions for Domain Accounts\" width=\"1004\" height=\"541\" aria-describedby=\"caption-attachment-26498\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26498\" class=\"wp-caption-text\">Assign Permissions for Domain Accounts<\/p>\n<\/div>\n<p><strong>10.<\/strong>\u00a0In the\u00a0<strong>Assign Permissions<\/strong>\u00a0window hit on the below left\u00a0<strong>Add<\/strong>\u00a0button, select your domain and type the name of a domain account in search filed.<\/p>\n<p>Choose the proper username from the list and hit\u00a0<strong>Add<\/strong>\u00a0button to add the account. Repeat the step if you want to add other domain users or groups. When you finish adding the domain users hit\u00a0<strong>OK<\/strong>\u00a0button to close the window and return previous setting.<\/p>\n<div id=\"attachment_26499\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Assign-Permissions.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26499\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Assign-Permissions.jpg\" sizes=\"auto, (max-width: 1156px) 100vw, 1156px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Assign-Permissions.jpg 1156w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Assign-Permissions-768x462.jpg 768w\" alt=\"Assign Permissions\" width=\"1156\" height=\"696\" aria-describedby=\"caption-attachment-26499\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26499\" class=\"wp-caption-text\">Assign Permissions<\/p>\n<\/div>\n<div id=\"attachment_26500\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Select-Users-and-Groups.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26500\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Select-Users-and-Groups.jpg\" sizes=\"auto, (max-width: 904px) 100vw, 904px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Select-Users-and-Groups.jpg 904w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Select-Users-and-Groups-768x585.jpg 768w\" alt=\"Select Users and Groups\" width=\"904\" height=\"689\" aria-describedby=\"caption-attachment-26500\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26500\" class=\"wp-caption-text\">Select Users and Groups<\/p>\n<\/div>\n<p><strong>11.<\/strong>\u00a0To assign a role for a domain account, select the desired name from the left plane and choose a predefined role, such as\u00a0<strong>Read-only<\/strong>\u00a0or\u00a0<strong>Administrator<\/strong>\u00a0from the right plane.<\/p>\n<p>Check the proper privileges you want to grant for this user and hit\u00a0<strong>OK<\/strong>\u00a0when you finish in order to reflect changes.<\/p>\n<div id=\"attachment_26501\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Assign-Admin-User-for-Domain.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26501\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Assign-Admin-User-for-Domain.jpg\" sizes=\"auto, (max-width: 873px) 100vw, 873px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Assign-Admin-User-for-Domain.jpg 873w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Assign-Admin-User-for-Domain-768x616.jpg 768w\" alt=\"Assign Admin User for Domain\" width=\"873\" height=\"700\" aria-describedby=\"caption-attachment-26501\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26501\" class=\"wp-caption-text\">Assign Admin User for Domain<\/p>\n<\/div>\n<p><strong>12.<\/strong>\u00a0That\u2019s all! The authentication process in\u00a0<strong>VMware ESXI hypervisor<\/strong>\u00a0from\u00a0<strong>VSphere Client<\/strong>\u00a0with a\u00a0<strong>Samba domain account<\/strong>\u00a0is pretty straightforward now.<\/p>\n<p>Just add the username and the password of a domain account in the login screen as shown in the below picture. Depending on level of permissions grated for the domain account you should be able to manage the hypervisor completely or just some parts of it.<\/p>\n<div id=\"attachment_26502\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-vSphere-Client-Login.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26502\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/VMware-vSphere-Client-Login.jpg\" alt=\"VMware vSphere Client Login\" width=\"568\" height=\"627\" aria-describedby=\"caption-attachment-26502\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26502\" class=\"wp-caption-text\">VMware vSphere Client Login<\/p>\n<\/div>\n<p>Although this tutorial mainly included only the steps required to join a\u00a0<strong>VMware ESXI hypervisor<\/strong>\u00a0into a\u00a0<strong>Samba4 AD DC<\/strong>, the same procedure as described in this tutorial applies for integrating a\u00a0<strong>VMware ESXI<\/strong>\u00a0host into a\u00a0<strong>Microsoft Windows Server 2012\/2016<\/strong>\u00a0realm.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/install-samba4-active-directory-ubuntu\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create an Active Directory Infrastructure with Samba4 on Ubuntu \u2013 Part 1 Samba\u00a0is a free Open Source software which provides a standard interoperability between\u00a0Windows OS\u00a0and\u00a0Linux\/Unix\u00a0Operating Systems. Samba can operate as a standalone file and print server for Windows and Linux clients through the\u00a0SMB\/CIFSprotocol suite or can act as an\u00a0Active Directory Domain Controller\u00a0or joined into a\u00a0Realm\u00a0as &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/02\/active-directory-ad\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;ACTIVE DIRECTORY (AD) Infrastructure with SAMBA4 on Ubuntu&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13405","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13405","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13405"}],"version-history":[{"count":3,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13405\/revisions"}],"predecessor-version":[{"id":13413,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13405\/revisions\/13413"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}