<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Windows Active Directory Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/windows-active-directory/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 11 Feb 2019 09:55:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>Join CentOS7 system into Windows Domain</title>
		<link>https://www.osradar.com/join-centos7-system-into-windows-domain/</link>
					<comments>https://www.osradar.com/join-centos7-system-into-windows-domain/#respond</comments>
		
		<dc:creator><![CDATA[osradar_editor]]></dc:creator>
		<pubDate>Mon, 11 Feb 2019 09:54:42 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Centos7]]></category>
		<category><![CDATA[Windows Active Directory]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=10675</guid>

					<description><![CDATA[<p>Why? That&#8217;s a good question. Why? That&#8217;s because then it allows us to authenticate users centrally whom already has Windows Active Directory user accounts. This really comes handy as we then don&#8217;t need to provision CentOS local user account as new users are in demand for server access. Think about a scenario, for example, a [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/join-centos7-system-into-windows-domain/">Join CentOS7 system into Windows Domain</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Why?<br />
That&#8217;s a good question. Why? That&#8217;s because then it allows us to authenticate users centrally whom already has Windows Active Directory user accounts. This really comes handy as we then don&#8217;t need to provision CentOS local user account as new users are in demand for server access. Think about a scenario, for example, a company whose having thousands of users who wish to have server access for  system administration. That would be a pain in the neck if our plan to setup each individual accounts locally. Problem even get started to worse if the server count increase over the time. Thus, having your LInux systems&#8217;s authentication over Windows Active Directory should be one of the obvious solutions.</p>
<h3>Getting Started</h3>
<p>This tutorial is based on the following configuration:</p>
<ul>
<li>domain name : osradar.com</li>
<li>workgroup : OSRADAR</li>
<li>kerberos realm : OSRADAR.COM</li>
<li>Winsdows AD IP address: 172.17.0.51</li>
<li>Windows AS DNS name: windows-ad.osradar.com</li>
<li>a valid user called &#8220;winaduser01&#8221; already existed at Windows AD.</li>
</ul>
<p>01. Install packages</p>
<pre class=""># yum install krb5-workstation pam_krb5 samba samba-client samba-winbind authconfig</pre>
<p>&nbsp;</p>
<p>02. Ensure that the clocks on both systems are in sync. Time synchronization is essential for Kerberos to work.</p>
<p>03. To have working DNS resolution, point all Linux client systems to Windows AD &#8211; Essential for Kerberos to work. Optionally, you can also work with /etc/hosts if required.</p>
<pre class=""># vim /etc/hosts

172.17.0.51 windows-ad.osradar.com</pre>
<p>04. Configure Kerberos to use AD Kerberos realm.</p>
<pre class="lang:sh decode:true"># vi /etc/krb5.conf

[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log

[libdefaults]
dns_lookup_realm = true
dns_lookup_kdc = true

ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
default_realm = OSRADAR.COM
default_ccache_name = KEYRING:persistent:%{uid}

[realms]
OSRADAR.COM = {
kdc = 172.17.0.51
admin_server = 172.17.0.51
}
</pre>
<p>&nbsp;</p>
<p>05. Verify Kerberos operation &#8211; (Assume following winaduser01 exist on the Windows AD)</p>
<pre class=""># kinit winaduser01
Password for winaduser01@OSRADAR.COM:</pre>
<p>(This of course is to get a Kerberos Ticket for our Linux client system)</p>
<pre class=""># klist

Ticket cache: FILE:/tmp/krb5cc_0
Default principal: winaduser01@OSRADAR.COM
Valid starting Expires Service principal
04/27/2019 00:42:19 04/27/2019 10:42:19 krbtgt/OSRADAR.COM@OSRADAR.COM
renew until 05/04/2019 00:42:10</pre>
<p>(To list whether do we have valid Kerberos Tickets now..)</p>
<pre class=""># kdestroy</pre>
<p>(Optionally, if you want to remove the existing Kerberos Ticket)</p>
<p>&nbsp;</p>
<p>06. Configure Samba to connect to AD server.</p>
<pre class="lang:sh decode:true "># vi /etc/samba/smb.conf

[global]
workgroup = OSRADAR
realm = OSRADAR.COM
security = ads
idmap config * : range = 16777216-33554431
winbind separator = +
template homedir = /home/%U
template shell = /bin/bash
kerberos method = secrets only
winbind use default domain = true
winbind offline logon = true

server string = Samba Server Version %v
netbios name = MYLINUXPC1
interfaces = lo ens9 172.17.0.0/24
hosts allow = 127. 172.17.0.
passdb backend = tdbsam
winbind enum users = yes
winbind enum groups = yes
client use spnego = yes
client ntlmv2 auth = yes
encrypt passwords = yes
idmap config MYCOMPANY:backend = rid
idmap config MYCOMPANY:range = 10000000-1999999</pre>
<p>&nbsp;</p>
<p>07. Check for configuration errors if present.</p>
<pre class=""># testparm</pre>
<p>&nbsp;</p>
<p>08. Configure NSS and PAM to use winbind for system authentication</p>
<pre class=""># authconfig --enablewinbind --enablewins --enablewinbindauth --update</pre>
<p>&nbsp;</p>
<p>09. Service Restarts</p>
<pre class=""># systemctl restart smb
# systemctl restart winbind</pre>
<p>&nbsp;</p>
<p>10. Lets add our linux client machine to the Winsows AD Domain</p>
<pre class=""># kinit winaduser01</pre>
<pre class=""># net ads join -U winaduser01
Enter winaduser's password:
Joined 'MYLINUXPC1' to dns domain 'OSRADAR.COM'</pre>
<p>&nbsp;</p>
<p>Congratulations. If you see the above message, it confirms that your Linux system is correctly joined with WIndows. Now, you can perform any user authentication against any user who has a valid account on windows Active Directory.</p>
<p>Optionally, if you want to leave the joined domains</p>
<pre class=""># net ads leave -U winaduser01</pre>
<p>&nbsp;</p>
<p><em><strong>&#8220;I hope this has been informative for you..&#8221;</strong></em></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/join-centos7-system-into-windows-domain/">Join CentOS7 system into Windows Domain</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/join-centos7-system-into-windows-domain/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
