Saturday 19 May 2018

Red Hat Enterprise Linux - Where's my LDAPSearch tool ?

Why oh why do I forget this ?

Running this command : -

ldapsearch -h ad2012.uk.ibm.com -p 389 -D CN=bpmbind,CN=Users,DC=uk,DC=ibm,DC=com -w Qp455w0rd -b CN=Users,DC=uk,DC=ibm,DC=com CN=bpm* CN

 on RHEL 7.5 ( Maipo ) gives me this: -

-bash: ldapsearch: command not found

A few clicks later ….

yum install -y  openldap-clients

Detected RHEL 7 server x86_64 ...
Wrote new config file /etc/yum.repos.d/ibm-yum-41186.repo

/usr/bin/yum --noplugins install -y openldap-clients
ftp3                                                                                                                                                                               | 2.0 kB  00:00:00     
ftp3-extras                                                                                                                                                                        | 2.0 kB  00:00:00     
ftp3-optional                                                                                                                                                                      | 2.0 kB  00:00:00     
ftp3-rh-common                                                                                                                                                                     | 2.1 kB  00:00:00     
ftp3-supplementary                                                                                                                                                                 | 2.0 kB  00:00:00     
server                                                                                                                                                                             | 2.9 kB  00:00:00     
(1/6): ftp3-extras/updateinfo                                                                                                                                                      | 153 kB  00:00:06     
(2/6): ftp3-extras/primary                                                                                                                                                         | 223 kB  00:00:06     
(3/6): ftp3-optional/updateinfo                                                                                                                                                    | 2.0 MB  00:00:18     
(4/6): ftp3/updateinfo                                                                                                                                                             | 2.7 MB  00:00:24     
(5/6): ftp3-optional/primary                                                                                                                                                       | 4.4 MB  00:00:29     
(6/6): ftp3/primary                                                                                                                                                                |  28 MB  00:01:21     
ftp3                                                                                                                                                                                          20399/20399
ftp3-extras                                                                                                                                                                                       838/838
ftp3-optional                                                                                                                                                                                 15063/15063
Resolving Dependencies
--> Running transaction check
---> Package openldap-clients.x86_64 0:2.4.44-15.el7_5 will be installed
--> Processing Dependency: openldap(x86-64) = 2.4.44-15.el7_5 for package: openldap-clients-2.4.44-15.el7_5.x86_64
--> Running transaction check
---> Package openldap.x86_64 0:2.4.44-13.el7 will be updated
---> Package openldap.x86_64 0:2.4.44-15.el7_5 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================================================================================================================
 Package                                               Arch                                        Version                                                Repository                                 Size
==========================================================================================================================================================================================================
Installing:
 openldap-clients                                      x86_64                                      2.4.44-15.el7_5                                        ftp3                                      190 k
Updating for dependencies:
 openldap                                              x86_64                                      2.4.44-15.el7_5                                        ftp3                                      355 k

Transaction Summary
==========================================================================================================================================================================================================
Install  1 Package
Upgrade             ( 1 Dependent package)

Total download size: 545 k
Downloading packages:
No Presto metadata available for ftp3
(1/2): openldap-clients-2.4.44-15.el7_5.x86_64.rpm                                                                                                                                 | 190 kB  00:00:04     
(2/2): openldap-2.4.44-15.el7_5.x86_64.rpm                                                                                                                                         | 355 kB  00:00:05     
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                     104 kB/s | 545 kB  00:00:05     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : openldap-2.4.44-15.el7_5.x86_64                                                                                                                                                        1/3 
  Installing : openldap-clients-2.4.44-15.el7_5.x86_64                                                                                                                                                2/3 
  Cleanup    : openldap-2.4.44-13.el7.x86_64                                                                                                                                                          3/3 
  Verifying  : openldap-clients-2.4.44-15.el7_5.x86_64                                                                                                                                                1/3 
  Verifying  : openldap-2.4.44-15.el7_5.x86_64                                                                                                                                                        2/3 
  Verifying  : openldap-2.4.44-13.el7.x86_64                                                                                                                                                          3/3 

Installed:
  openldap-clients.x86_64 0:2.4.44-15.el7_5                                                                                                                                                               

Dependency Updated:
  openldap.x86_64 0:2.4.44-15.el7_5                                                                                                                                                                       

Complete!

Removed temporary configuration


Now we have it ….

which ldapsearch

/bin/ldapsearch

ls -al `which ldapsearch`

-rwxr-xr-x 1 root root 85928 Apr  3 13:04 /bin/ldapsearch

And now we're good to go: -

ldapsearch -h ad2012.uk.ibm.com -p 389 -D CN=bpmbind,CN=Users,DC=uk,DC=ibm,DC=com -w Qp455w0rd -b CN=Users,DC=uk,DC=ibm,DC=com CN=bpm* CN

# extended LDIF
#
# LDAPv3
# base <CN=Users,DC=uk,DC=ibm,DC=com> with scope subtree
# filter: CN=bpm*
# requesting: CN 
#

# bpmadmin, Users, uk.ibm.com
dn: CN=bpmadmin,CN=Users,DC=uk,DC=ibm,DC=com
cn: bpmadmin

# bpmbind, Users, uk.ibm.com
dn: CN=bpmbind,CN=Users,DC=uk,DC=ibm,DC=com
cn: bpmbind

# search result
search: 2
result: 0 Success

# numResponses: 3
# numEntries: 2



No comments:

Visual Studio Code - Wow 🙀

Why did I not know that I can merely hit [cmd] [p]  to bring up a search box allowing me to search my project e.g. a repo cloned from GitHub...