2008年7月16日水曜日

LDAPサーバー及びLDAPクライアント設定ファイルについて

># vi /etc/openldap/slapd.conf

#######################################################################
# ldbm and/or bdb database definitions
#######################################################################


#database bdb
#suffix "dc=my-domain,dc=com" # コメントアウト

          ↓
suffix "dc=hoge,dc=fuga,dc=com" # 自ドメインに変更

#rootdn "cn=Manager,dc=my-domain,dc=com" # コメントアウト
          ↓
rootdn "cn=Manager,dc=hoge,dc=fuga,dc=com" # 自ドメインに変更

# Cleartext passwords, especially for the rootdn, should
# be avoided. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
# rootpw secret
# rootpw {crypt}ijFYNcSNctBYg

# 暗号化されたパスワードを設定します。

rootpw {MD5}xxxxxxxxxxxxxxxxxxxxxxxx # 後述のslappasswdにて説明

# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.

directory /var/lib/ldap

# Indices to maintain for this database
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub

# Replicas of this database
#replogfile /var/lib/ldap/openldap-master-replog
#replica host=ldap-1.example.com:389 starttls=critical
# bindmethod=sasl saslmech=GSSAPI
# authcId=host/ldap-master.example.com@EXAMPLE.COM


# 以下を追加
access to attrs=userPassword
    by self write
    by dn="cn=Manager,dc=hoge,dc=fuga,dc=com" write
    by anonymous auth
    by * none

access to *
    by dn="cn=Manager,dc=hoge,dc=fuga,dc=com" write
    by self write
    by * read


予めslappasswdにて暗号化されたパスワードを生成しておきます。
secretの部分は任意のパスワードを指定します。

# slappasswd -s secret -h {MD5}
{MD5}xxxxxxxxxxxxxxxxxxxxxxxx

表示された{MD5}~の部分を前述のslapd.confのrootpw行に記述します。



LDAPクライアントの設定
># vi /etc/openldap/ldap.conf

# See ldap.conf(5) for details
# This file should be world readable but not world writable.

#BASE dc=example, dc=com

       ↓
BASE dc=hoge,dc=fuga,dc=com # 自ドメインに変更


nss_ldapの設定
># vi /etc/ldap.conf

# The distinguished name of the search base.
#base dc=example,dc=com

       ↓
base dc=hoge,dc=fuga,dc=com # 自ドメインに変更

0 件のコメント: