centos7 ldapsearchを使用できるようにする

centos7 ldapsearchを使用できるようにする

centos7でldapsearchコマンドを使用したかったので、使用できるようにするまでの手順を記述してます。CentOSのバージョンは7.9.2009となります。

環境

  • OS CentOS 7.9.2009 (Core)

ldapsearchインストール

ldapsearchを使用できるようにするには「openldap-clients」をインストールします。

sudo yum install openldap-clients

これで「ldapsearch」が使用できるようになります。

ldapsearch -V

<出力結果>
ldapsearch: @(#) $OpenLDAP: ldapsearch 2.4.44 (Sep 30 2020 17:16:36) $
        mockbuild@x86-02.bsys.centos.org:/builddir/build/BUILD/openldap-2.4.44/openldap-2.4.44/clients/tools
        (LDAP library: OpenLDAP 20444)
ldap_sasl_interactive_bind_s: Can't contact LDAP server (-1)

CentOs8の場合

centos8の場合も、同様です。

sudo dnf install openldap-clients

インストール後にバージョンを確認してみます。

ldapsearch -V

<出力結果>
ldapsearch: @(#) $OpenLDAP: ldapsearch 2.4.46 (Sep 24 2020 17:47:18) $
        mockbuild@x86-02.mbox.centos.org:/builddir/build/BUILD/openldap-2.4.46/openldap-2.4.46/clients/tools
        (LDAP library: OpenLDAP 20446)
ldap_sasl_interactive_bind_s: Can't contact LDAP server (-1)