<?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>directory Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/directory/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Fri, 03 Aug 2018 07:38:52 +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>How to install OpenLDAP on CentOS 7</title>
		<link>https://www.osradar.com/how-to-install-openldap-on-centos-7/</link>
					<comments>https://www.osradar.com/how-to-install-openldap-on-centos-7/#comments</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Fri, 03 Aug 2018 07:36:51 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[openLDAP]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=4995</guid>

					<description><![CDATA[<p>We like CentOS very much to be a server operating system, I think we have made that clear; it is a great system, easy to use and maintain, and you can install many specific tools to manage services within a network server. It is also compatible with the RHEL software and repository, providing a good [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-openldap-on-centos-7/">How to install OpenLDAP on CentOS 7</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>We like CentOS very much</strong> to be a server operating system, I think we have made that clear; it is a great system, easy to use and maintain, and you can install many specific tools to manage services within a network server. It is also compatible with the RHEL software and repository, providing a good number of applications available.</p>
<p>One of those important applications that can be installed in <strong>CentOS 7</strong>, oriented to server management is <strong>OpenLDAP</strong> which is an open <strong>LDAP</strong> implementation that allows us to access an orderly and distributed directory service to search for diverse information in a network environment, ie a centralized way to store contact information in an organization.</p>
<p>OpenLDAP has four main components:</p>
<ul>
<li>slapd: autonomous LDAP daemon.</li>
<li>slurpd: standalone LDAP update replication daemon.</li>
<li>LDAP protocol support library routines</li>
<li>Utilities tools and customers.</li>
</ul>
<p>In this tutorial we will install OpenLDAP in cents 7.</p>
<h2>Let&#8217;s get to work</h2>
<h3>1.- Upgrading the system and installing openldap packages</h3>
<p>As always, the first thing to do is to update the system.</p>
<pre class="">:~# yum update</pre>
<figure id="attachment_5109" aria-describedby="caption-attachment-5109" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5109" src="https://www.osradar.com/wp-content/uploads/2018/08/1.png" alt="1.- Upgrading the system" width="1366" height="736" srcset="https://www.osradar.com/wp-content/uploads/2018/08/1.png 1366w, https://www.osradar.com/wp-content/uploads/2018/08/1-300x162.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/1-768x414.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/1-1024x552.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/1-696x375.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/1-1068x575.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/1-780x420.png 780w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5109" class="wp-caption-text">1.- Upgrading the system</figcaption></figure>
<p>Now we proceed to install the OpenLDAP packages.</p>
<pre class="">:~# yum install openldap compat-openldap openldap-clients openldap-servers openldap-servers-sql openldap-devel</pre>
<figure id="attachment_5110" aria-describedby="caption-attachment-5110" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5110" src="https://www.osradar.com/wp-content/uploads/2018/08/2.png" alt="2.- Installing openldap packages" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/2.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/2-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/2-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/2-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/2-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/2-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/2-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5110" class="wp-caption-text">2.- Installing openldap packages</figcaption></figure>
<p>Once the packages have been installed, we must enable and initialize the openLDAP service.</p>
<pre class="">:~# systemctl enable slapd
:~# systemctl start slapd</pre>
<figure id="attachment_5111" aria-describedby="caption-attachment-5111" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5111" src="https://www.osradar.com/wp-content/uploads/2018/08/3.png" alt="3.- enabling slapd" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/3.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/3-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/3-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/3-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/3-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/3-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/3-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5111" class="wp-caption-text">3.- enabling slapd</figcaption></figure>
<h3>2.- Configuring openLDAP server</h3>
<p>First we must generate the OpenLDAP root password. That&#8217;s why we write:</p>
<pre class="">:~# slappasswd -h {SSHA} -s your_password</pre>
<p>and we&#8217;ll get something like this:</p>
<pre class="">:~# {SSHA}XKrTsGmjsV0Rw1lZzLaOr7pqvZRrbv8A</pre>
<p>Next, create the openLDAP configuration file so that it can work correctly. We write:</p>
<pre class="">:~# nano conf.ldif</pre>
<p>And we place the following content:</p>
<pre class="">dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcSuffix
olcSuffix: dc=osradar,dc=local

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootDN
olcRootDN: cn=angelo,dc=osradar,dc=local

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootPW
olcRootPW: {SSHA}XKrTsGmjsV0Rw1lZzLaOr7pqvZRrbv8A

</pre>
<p>From that file you must modify these three parameters at your convenience:</p>
<ul>
<li>olcSuffix: Basically the suffix is your hostname. For your reference, in this tutorial the hostname is <strong>osradar.local</strong></li>
<li>olcRootDN: This refers to the openLDAP administrator user.</li>
<li>olcRootPW: Here is the password generated above. Put yours up.</li>
</ul>
<figure id="attachment_5113" aria-describedby="caption-attachment-5113" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5113" src="https://www.osradar.com/wp-content/uploads/2018/08/4.png" alt="4.- Editing conf file" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/4.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/4-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/4-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/4-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/4-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/4-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/4-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5113" class="wp-caption-text">4.- Editing conf file</figcaption></figure>
<p>when we finish editing the file, we proceed to &#8220;upload&#8221; the configuration created to openLDAP with ldapmodify.</p>
<pre class="">:~# ldapmodify -Y EXTERNAL -H ldapi:/// -f conf.ldif</pre>
<figure id="attachment_5114" aria-describedby="caption-attachment-5114" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5114" src="https://www.osradar.com/wp-content/uploads/2018/08/5.png" alt="5.- ldapmodify" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/5.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/5-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/5-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/5-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/5-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/5-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/5-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5114" class="wp-caption-text">5.- ldapmodify</figcaption></figure>
<h3>3.- Configuring the openLDAP Database</h3>
<p>Now we proceed to copy the example database and grant it permissions.</p>
<pre class="">:~# cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
:~# chown ldap:ldap /var/lib/ldap/*</pre>
<figure id="attachment_5115" aria-describedby="caption-attachment-5115" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5115" src="https://www.osradar.com/wp-content/uploads/2018/08/6.png" alt="6.- Configuring database openldap" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/6.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/6-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/6-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/6-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/6-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/6-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/6-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5115" class="wp-caption-text">6.- Configuring database openldap</figcaption></figure>
<p>And we add the rest of the schemas.</p>
<pre class="">:~# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/cosine.ldif
:~# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/nis.ldif
:~# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/inetorgperson.ldif</pre>
<p>Now we create our file named base.ldif</p>
<pre class="">:~# nano base.ldif</pre>
<p>And within this we add the following:</p>
<pre class="">dn: dc=osradar,dc=local
dc: osradar
objectClass: top
objectClass: domain

dn: cn=angelo ,dc=osradar,dc=local
objectClass: organizationalRole
cn: angelo
description: LDAP Manager

dn: ou=users,dc=osradar,dc=local
objectClass: organizationalUnit
ou: Users

dn: ou=Group,dc=osradar,dc=local
objectClass: organizationalUnit
ou: Group</pre>
<figure id="attachment_5116" aria-describedby="caption-attachment-5116" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5116" src="https://www.osradar.com/wp-content/uploads/2018/08/7.png" alt="7.- Creating base file" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/7.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/7-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/7-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/7-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/7-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/7-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/7-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5116" class="wp-caption-text">7.- Creating base file</figcaption></figure>
<p>Now we must write the command to create the directory structure. In doing so we will be asked for the openldap password.</p>
<pre class="">:~# ldapadd -x -W -D "cn=angelo,dc=osradar,dc=local" -f base.ldif</pre>
<p>Of course, change the parameters to your own.</p>
<figure id="attachment_5117" aria-describedby="caption-attachment-5117" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5117" src="https://www.osradar.com/wp-content/uploads/2018/08/8.png" alt="8.- building directory structure" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/8.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/8-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/8-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/8-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/8-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/8-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/8-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5117" class="wp-caption-text">8.- building directory structure</figcaption></figure>
<h3>4.-Creating openLDAP User</h3>
<p>now we proceed to create a user for openLDAP. An easy way to do this is to create a file for the new user, I&#8217;ll call it newuser.ldif.</p>
<pre class="">:~# nano newuser.ldif</pre>
<p>And in it we will copy the following content:</p>
<pre class="">dn: uid=user,ou=users,dc=osradar,dc=local
objectClass: top
objectClass: account
objectClass: posixAccount
objectClass: shadowAccount
cn: user
uid: user
uidNumber: 9999
gidNumber: 100
homeDirectory: /home/user
loginShell: /bin/bash
gecos: user
userPassword: {crypt}x
shadowLastChange: 17058
shadowMin: 0
shadowMax: 99999
shadowWarning: 7</pre>
<p>change what you have to change.</p>
<figure id="attachment_5119" aria-describedby="caption-attachment-5119" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5119" src="https://www.osradar.com/wp-content/uploads/2018/08/9-1.png" alt="9.- Creating new user" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/9-1.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/9-1-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/9-1-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/9-1-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/9-1-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/9-1-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/9-1-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5119" class="wp-caption-text">9.- Creating new user</figcaption></figure>
<p>Now with the ldapadd command we proceed to create the new user.</p>
<pre class="">:~# ldapadd -x -W -D "cn=angelo,dc=osradar,dc=local" -f newuser.ldif</pre>
<figure id="attachment_5121" aria-describedby="caption-attachment-5121" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5121" src="https://www.osradar.com/wp-content/uploads/2018/08/10.png" alt="10.- Adding the new user" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/10.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/10-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/10-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/10-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/10-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/10-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/10-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5121" class="wp-caption-text">10.- Adding the new user</figcaption></figure>
<p>Now we are going to give the new user a password.</p>
<pre class="">:~# ldappasswd -s pass321 -W -D "cn=angelo,dc=osradar,dc=local" -x "uid=user,ou=users,dc=osradar,dc=local"</pre>
<figure id="attachment_5122" aria-describedby="caption-attachment-5122" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5122" src="https://www.osradar.com/wp-content/uploads/2018/08/11.png" alt="11.- Setting password to new user" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/11.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/11-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/11-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/11-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/11-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/11-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/11-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5122" class="wp-caption-text">11.- Setting password to new user</figcaption></figure>
<h3>5.- Finals configurations</h3>
<p>We then proceed to add the rules in the firewall so that openLDAP runs smoothly.</p>
<pre class="">:~# firewall-cmd --permanent --add-service=ldap
:~# firewall-cmd --reload</pre>
<figure id="attachment_5123" aria-describedby="caption-attachment-5123" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5123" src="https://www.osradar.com/wp-content/uploads/2018/08/12.png" alt="12.- Enabling openldap at firewall" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/12.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/12-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/12-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/12-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/12-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/12-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/12-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5123" class="wp-caption-text">12.- Enabling openldap at firewall</figcaption></figure>
<h3>6.- Testing the server</h3>
<p>We verify that everything is in order:</p>
<pre class="">:~# ldapsearch -x cn=user -b dc=osradar,dc=local</pre>
<p>If the terminal displays the user information, then everything went well.</p>
<figure id="attachment_5124" aria-describedby="caption-attachment-5124" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5124" src="https://www.osradar.com/wp-content/uploads/2018/08/77.png" alt="12 .- Testing the installations" width="1368" height="710" srcset="https://www.osradar.com/wp-content/uploads/2018/08/77.png 1368w, https://www.osradar.com/wp-content/uploads/2018/08/77-300x156.png 300w, https://www.osradar.com/wp-content/uploads/2018/08/77-768x399.png 768w, https://www.osradar.com/wp-content/uploads/2018/08/77-1024x531.png 1024w, https://www.osradar.com/wp-content/uploads/2018/08/77-696x361.png 696w, https://www.osradar.com/wp-content/uploads/2018/08/77-1068x554.png 1068w, https://www.osradar.com/wp-content/uploads/2018/08/77-809x420.png 809w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-5124" class="wp-caption-text">12 .- Testing the installations</figcaption></figure>
<p>And that&#8217;s it, we have our OpenLDAP server up and running. We would only have to go and configure each client so that it can be logged into the server. This will depend on each GNU/LINUX distribution the client has.</p>
<p>Please share this article through your social networks.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-openldap-on-centos-7/">How to install OpenLDAP on CentOS 7</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/how-to-install-openldap-on-centos-7/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
