Instructor: OpenLDAP installation.
This lesson is actually related to module five
where we covered how the users are created
when we need the active directory
type of directory services.
So I am including in this module is because
in this module that's where we have enabled the networking
to talk to outside world,
which is to have internet enabled.
So if you need to go back to module five
and review what LDAP, OpenLDAP is,
what are the differences
between each of the directory services,
you should go back and review it
and then you could always come back to this lesson.
Anyway, so OpenLDAP,
what exactly OpenLDAP is.
So OpenLDAP is basically an open source implementation
of Lightweight Active Directory Access Protocol
which is also LDAP.
It is developed by OpenLDAP project.
So there is a company which is open source,
they actually do community work.
A lot of people have joined together
to build this product called OpenLDAP.
And it is an internet protocol
that email and other programs like user access
used to look up contact information from the server.
It is released under OpenLDAP public license.
It is available for all major Linux distributions,
also AIX, Android, HP-UX,
OS, X Solaris and even Windows are nowadays using OpenLDAP
if there's a need because it's free
and you would have to pay active directory
for that product to Microsoft.
So it is becoming very popular, especially in Linux world
when you have thousands of users that you need to manage
and you need to have them accessed
to many different servers.
So that's pretty much what OpenLDAP is.
Now, the OpenLDAP, once we do the installation,
it's completed, the service that we need to have enabled
and running is called SLAPD.
To stop and start the service for OpenLDAP,
it's simply systemctl start slapd.
Same thing if you want to enable it,
meaning if you want the service to start when your computer
or when your Linux boot up,
then you have to run the command, systemctl enable slapd.
Of course I didn't include the stop.
I'm sure you would know that.
And also you could do the restart command as well
systemctl restart with the service name.
Where are the configuration files are located?
Once you have the OpenLDAP installation
successfully completed, then you will find that
in etc/OpenLDAP/slapd.d.
This is the directory
where you have all the configuration files
where you could go in and make changes to it.
So, let's log into our Linux machine
and we'll go over the installation of OpenLDAP.
Okay, so I have this Linux machine open.
I am logged in as myself.
I will become root.
Okay, now before you go ahead and do the installation,
make sure your Linux machine can go outside the internet.
And the best way to find out is always do ping command
to ping any server that you like.
And if you get the 64 byte back
and ICMP is coming back with the time to ping,
then it means you can reach it.
You could reach the Google server. Perfect!
Let's clear the screen.
Now, the command to install the OpenLDAP is
yum install OpenLDAP.
I believe it's OpenLDAP
or it's probably open-ldap.
But anyway, we'll try just OpenLDAP
And I want to do asterisk here
and as well as I want to do asterisk here.
The reason I wanted to put these stars before and after,
it means any package that matches OpenLDAP,
whether the OpenLDAP comes after the name or before a name,
then it will download all the OpenLDAP packages.
So go ahead, hit enter.
It's gonna go out
and check all the mirrors, all the repositories
that are available to us.
And here, it has a list of all the OpenLDAP packages,
all the RPMs and then you could see in
that installing the packages,
you'll see right here, here's a list of all the packages
that it will install on your system.
And here is a quick summary for the transaction.
And you could see the size is 4.5 megabyte.
So, is this okay?
Yes, of course you want to install that.
So hit Y and hit enter.
So always first it downloads the packages.
Once the packages are downloaded,
then it goes through the installation of those packages.
Once the installation is completed,
it will clean up any of the remaining things
that it's not needed.
It'll clean up,
it'll verify the packages are done, it's installed
and it will give you a quick summary at the bottom.
And when you see the message
right at the bottom says complete,
it means it has completed successfully.
So now you have the OpenLDAP installation completed.
Now it's time to do the configuration.
Just one thing I just wanted to add quickly.
I am not going to do the complete installation of,
sorry, complete configuration of the OpenLDAP is because
it requires a lot of work.
It is a completely separate topic
'cause it could take hours and hours
depending on how do you want to configure it
based on your environment.
It's just a matter of OpenLDAP.
I want you to have some kind of exposure to it
so you know how to install it, how does it work?
And there is a way,
if you need to have some kind of directory services,
your environment then that's how you go about it.
So now we have a download.
So let's say if you want to enable start the service,
so you remember the start the service is
systemctl start slapd.
Okay.
So it has started and how do you verify it?
You could just do systemctl status
and you'll see that it is up and running.
Especially when you are using a a GUI terminal,
you'll see it is active and running and it is in green
and all the other packages and package information
where those are located,
where the file is located, everything is here.
You could also test another way that
if the service or the process is running
and I'm sure you know by now,
that command is ps-ef
and then you grep for slapd.
And you'll see right here,
the first line you'll see LDAP usr/sbin.
This is the process that is running.
Again, the second one is just the process
is just the command itself.
Since I ran the command, it is grepping for itself.
So the first one has verified that we have
the OpenLDAP process.
It's running the configuration file are located in
etc/openldap/slapd.d directory.
When you go into this directory,
you could do simply ls-l or ltr,
you'll see these are the configuration file.
You will have to go into these configuration file,
modify the way you want to.
And on your system local file system,
you will have to actually go to one more file,
which is etc.
And the file name is nsswitch.conf file.
If you go into that conf file,
you'll see right here
where it says password.
See right here it says files.
It means first and every time I use a login,
it will go to a file.
And which file is that?
That file is etc password.
That is a kind of a local database
that is in your Linux machine or local file
that keeps the inventory of all the users
that are locally created.
So the first time you user logs in,
it will always go to the file.
And if the user is not found,
then it will go to another one.
Then you have to see sss,
you have to replace it with L-D-A-P, ldap.
It will go to that LDAP machine
and then it will get authenticated.
Now remember one thing that ldap,
we have installed LDAP on the same machine
that we need the authentication from.
So this is usually not how the environment
or the scenario works.
Usually system administrators,
they install the OpenLDAP software on another Linux machine,
which becomes a directory server.
And then you could go in and configure on your client
where to look up for LDAP services,
you have to modify your etc/hostname and few other files.
And again as I said before,
there are a few configuration changes
that you would have to make.
And I will include an article
that I have from online.
One of the OpenLDAP has the article, how to configure it.
So if you really are interested in configuring OpenLDAP
and your OpenLDAP server, you could review that article
and then you will be able to configure it.
So anyway, hopefully you have it installed correctly
and now you understand the clear difference
between all those directories servers or services
that are out there.