読み 【エルダップ】 簡単に言えばIDやパスワードを一元管理するデータベース。~ 一般的にオープンソースの[[OpenLDAP:http://www.openldap.org/]]のことを言う。 #contents **参考サイト [#y3bf2732] [[シングル・サインオン、ディレクトリサーバ:http://www.atmarkit.co.jp/fnetwork/index_index.html#sso]]~ [[そろそろLDAPにしてみないか?:http://gihyo.jp/admin/serial/01/ldap]]~ [[はやぐい:http://www.hayagui.com/openldap01.html]] Samba連動~ [[OpenLDAP+Samba:http://fedorasrv.com/openldap.shtml]]~ [[LDAP+Samba+PAMでプライマリドメインコントローラを作ろう!:http://www.planets.ath.cx/RedHat/pdc.html]] **インストール [#i2894a61] # yum install openldap-servers # yum install openldap-clients 設定 # vi vi /etc/openldap/slapd.conf # スキーマファイル指定 include /etc/openldap/schema/core.schema include /etc/openldap/schema/cosine.schema include /etc/openldap/schema/inetorgperson.schema include /etc/openldap/schema/nis.schema # PID,起動時オプション保存場所 pidfile /var/run/slapd.pid argsfile /var/run/slapd.args # 使用DB Berkeley DB database bdb # ベースのDN suffix "dc=example,dc=com" # 管理者のDN rootdn "cn=Manager,dc=example,dc=com" # 管理者のパスワード rootpw secret # データ保存場所 directory /var/lib/ldap # INDEX 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 # /etc/rc.d/init.d/ldap start **LDIFの作成 [#hdb53394] ディレクトリ構造で管理するのでルートをLDIFの形式のファイルを作成し、追加する~ ファイル名は任意 root.ldif dn: dc=example,dc=com objectClass: dcObject objectClass: organization dc: example o: example # ldapadd -x -D 'cn=Manager,dc=example,dc=com' -w secret -f root.ldif - -x 簡易認証 - -D 管理者DN - -w パスワードを指定 - -f ldifファイルを指定 部署のLDIFを作成し、追加 unit.ldif dn: ou=abc,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: abc dn: ou=xyz,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: xyz # ldapadd -x -D 'cn=Manager,dc=example,dc=com' -w secret -f unit.ldif ユーザーのLDIFを作成し、追加 user.ldif dn: cn=Taro Yamada,ou=abc,dc=example,dc=com objectClass: top objectClass: person cn: Taro Yamada sn: Yamada dn: cn=Hanako Yamada,ou=abc,dc=example,dc=com objectClass: top objectClass: person cn: Hanako Yamada sn: Yamada # ldapadd -x -D 'cn=Manager,dc=example,dc=com' -w secret -f user.ldif **検索 [#w776613f] 部分一致検索もOK - -b 検索ベース - -s 検索スコープ base(ベースエントリのみ),one(ベース直下のみ),sub(ベース以下全部) # ldapsearch -x -b 'dc=example,dc=com' -s sub '(cn=Hanako Yamada)' **GUIソフト [#ma56f3cd] [[LDAP Browser/Editor:http://www-unix.mcs.anl.gov/~gawor/ldap/download.html]] ZIPファイルを解凍して lbe.bat をダブルクリックで起動 #exlink