手当たり次第に書くんだ

飽きっぽいのは本能

Ubuntu 22.04 389 Directory Server #3 – ベースエントリーの登録

389 Directory Server に base entry を登録する手順です。LDAP では suffix だけ作成しても、実際に参照する OU、ユーザー、グループの入れ物がなければ運用できません。

389 Directory Server シリーズ

前の記事: Ubuntu 22.04 389 Directory Server #2 – TLS 有効化と LDAPS 設定

次の記事: Ubuntu 22.04 389 Directory Server #4 – BIND ユーザーとアクセス制御

base entry の考え方

base entry は、ディレクトリツリーの土台です。例として、ユーザー用の ou=users、グループ用の ou=groups、サービスアカウント用の ou=service を作成します。

DN用途
dc=example,dc=localLDAP ツリーの基点
ou=users,dc=example,dc=localユーザーを格納する
ou=groups,dc=example,dc=localグループを格納する
ou=service,dc=example,dc=localBIND ユーザーなどを格納する

LDIF の作成

cat <<'EOF' > /tmp/base-entry.ldif
dn: dc=example,dc=local
objectClass: top
objectClass: domain
dc: example

dn: ou=users,dc=example,dc=local
objectClass: top
objectClass: organizationalUnit
ou: users

dn: ou=groups,dc=example,dc=local
objectClass: top
objectClass: organizationalUnit
ou: groups

dn: ou=service,dc=example,dc=local
objectClass: top
objectClass: organizationalUnit
ou: service
EOF

登録

ldapadd -x -H ldaps://ldap.example.local   -D 'cn=Directory Manager'   -W   -f /tmp/base-entry.ldif

確認

ldapsearch -x -H ldaps://ldap.example.local   -b dc=example,dc=local   '(objectClass=organizationalUnit)' dn

まとめ

base entry は LDAP 設計の骨格です。Samba、Postfix、SSSD などから参照する前に、ユーザー、グループ、サービスアカウントの置き場所を明確にしておくと後続の設定が読みやすくなります。

Ubuntu 22.04 389 Directory Server #3 – ベースエントリーの登録

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)

トップへ戻る