ユーザーを一元管理 LDAP
の編集
https://yassu.jp/pukiwiki/index.php?%A5%E6%A1%BC%A5%B6%A1%BC%A4%F2%B0%EC%B8%B5%B4%C9%CD%FD+LDAP
[
トップ
] [
編集
|
差分
|
バックアップ
|
添付
|
リロード
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
-- 雛形とするページ --
(no template pages)
読み 【エルダップ】 簡単に言えばIDやパスワードを一元管理するデータベース。~ 一般的にオープンソースの[[OpenLDAP:http://www.openldap.org/]]のことを言う。 サーバにはApacheDSもあるが、ドキュメントが充実しているOpenLDAPをサーバに採用~ クライアントはApache Directory Studioを採用する #contents **OpenLDAPのインストール [#i2894a61] # yum install openldap openldap-devel openldap-servers openldap-clients 設定 # 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/openldap/slapd.pid argsfile /var/run/openldap/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)' **クライアント [#u3136dd0] Apache Directory Studioを利用~ eclipseを使用するので、こちら[[Eclipse PDT]]を参考にインストールしておく ヘルプ - ソフトウェア更新 - 検索およびインストール - インストールする新規フィーチャーを検索~ 新規リモート・サイト から名前「Apache Directory Studio Update Site」URL「http://directory.apache.org/studio/update/1.x」を入力 Apache Directory Studio LDAP Browserを選択してインストール LDAP connectionを作成する~ ポートは389 サーバ側のhosts.allowなどで制限をかけている場合は以下のように追加してやる slapd: 127.0.0.1 192.168.1. 参考~ http://www.atmarkit.co.jp/fjava/rensai3/eclipseplgn21/eclipseplgn21_1.html 他には[[LDAP Browser/Editor:http://www-unix.mcs.anl.gov/~gawor/ldap/download.html]]がある~ ZIPファイルを解凍して lbe.bat をダブルクリックで起動 **参考サイト [#y3bf2732] OpenLDAP -[[シングル・サインオン、ディレクトリサーバ: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]] #exlink
タイムスタンプを変更しない
読み 【エルダップ】 簡単に言えばIDやパスワードを一元管理するデータベース。~ 一般的にオープンソースの[[OpenLDAP:http://www.openldap.org/]]のことを言う。 サーバにはApacheDSもあるが、ドキュメントが充実しているOpenLDAPをサーバに採用~ クライアントはApache Directory Studioを採用する #contents **OpenLDAPのインストール [#i2894a61] # yum install openldap openldap-devel openldap-servers openldap-clients 設定 # 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/openldap/slapd.pid argsfile /var/run/openldap/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)' **クライアント [#u3136dd0] Apache Directory Studioを利用~ eclipseを使用するので、こちら[[Eclipse PDT]]を参考にインストールしておく ヘルプ - ソフトウェア更新 - 検索およびインストール - インストールする新規フィーチャーを検索~ 新規リモート・サイト から名前「Apache Directory Studio Update Site」URL「http://directory.apache.org/studio/update/1.x」を入力 Apache Directory Studio LDAP Browserを選択してインストール LDAP connectionを作成する~ ポートは389 サーバ側のhosts.allowなどで制限をかけている場合は以下のように追加してやる slapd: 127.0.0.1 192.168.1. 参考~ http://www.atmarkit.co.jp/fjava/rensai3/eclipseplgn21/eclipseplgn21_1.html 他には[[LDAP Browser/Editor:http://www-unix.mcs.anl.gov/~gawor/ldap/download.html]]がある~ ZIPファイルを解凍して lbe.bat をダブルクリックで起動 **参考サイト [#y3bf2732] OpenLDAP -[[シングル・サインオン、ディレクトリサーバ: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]] #exlink
テキスト整形のルールを表示する