LDAPから情報を取得する際に問題があります。

LDAPから情報を取得する際に問題があります。

Centos 8にSymasのopenldapをインストールしました。

  • 修正しました/etc/openldap/slapd.d/cn=config/olcDatabase={2}mdb.ldif 以下を追加して

    olcRootPW: {SSHA}...など。パスワードを作成する行

  • slapd設定ファイルを次のように変更します。

    **BASE    dc=example**
    
    **URI     ldap://localhost:389**
    
  • 次のファイルが追加されました。

サンプル組織.ldif

dn : dc=example

objectclass : domain

dc : example

dn : ou=Accountants,dc=example

objectClass : organizationalUnit

ou : Accountants

dn : ou=Engineers,dc=example

objectClass : organizationalUnit

ou : Engineers

端末で次を実行します。

ldapadd -x -c -W -D "cn=Manager,dc=my-domain,dc=com" -H ldap://localhost:389 -f SampleOrganization.ldif

その後、パスワードを入力してください。エラーが発生せず、オブジェクトが追加されたように見えます。

今何を検索しようとしたときに発生する問題は、次のように検索されます。

ldapsearch -W -D "cn=manager,dc=mydomain,dc=com" -H ldap://127.0.0.1:389 -b "ou=engineer,dc=example" "smith"


検索してみたいと思いました。叩いた猫次のエラーが発生します。

6031b551 ldif_read_file: checksum error on "/etc/openldap/slapd.d/cn=config/olcDatabase={0}config.ldif"
6031b551 ldif_read_file: checksum error on "/etc/openldap/slapd.d/cn=config/olcDatabase={2}mdb.ldif"
6031b551 The first database does not allow slapcat; using the first available one (2)

この問題の原因は何か混乱しています。チェックサムエラーかもしれません。もしそうなら、どうすれば解決しますか?

何も検索されておらず、以下を提供します。

# extended LDIF
#
# LDAPv3
# base <dc=example> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2
result: 32 No such object

# numResponses: 1

ベストアンサー1

/etc/openldap/slapd.d/cn=config/olcDatabase={2}mdb.ldifを修正しました。

back-configファイルはプレーンテキストファイルのように編集できません。構成を変更するには、ldapd、ldapmodifyを使用してLDAP書き込み操作を送信する必要があります。

6031b551 ldif_read_file: checksum error on

back-configのLDIFファイルを手動で変更した結果です。

おすすめ記事