ページへ戻る

− Links

 印刷 

Gentoo Linuxな生活​/LDAP設定 のバックアップの現在との差分(No.1) :: Nest Of Hawk

xpwiki:Gentoo Linuxな生活/LDAP設定 のバックアップの現在との差分(No.1)

  Next »[4]
1: 2011-01-07 (金) 00:45:40 maruo[5] ソース[6] 現: 2011-01-11 (火) 01:09:44 maruo[5] ソース[7]
Line 26: Line 26:
 include        /etc/openldap/schema/inetorgperson.schema  include        /etc/openldap/schema/inetorgperson.schema
 include        /etc/openldap/schema/nis.schema  include        /etc/openldap/schema/nis.schema
 + 
 Uncomment modulepath and hdb module  Uncomment modulepath and hdb module
 # Load dynamic backend modules:  # Load dynamic backend modules:
Line 38: Line 38:
 # moduleload    back_meta.so  # moduleload    back_meta.so
 # moduleload    back_dnssrv.so  # moduleload    back_dnssrv.so
 + 
 # Uncomment sample access restrictions (Note: maintain indentation!)  # Uncomment sample access restrictions (Note: maintain indentation!)
 access to *  access to *
Line 44: Line 44:
   by users read    by users read
   by anonymous auth    by anonymous auth
 + 
 # BDB Database definition  # BDB Database definition
 + 
 database        hdb  database        hdb
 suffix          "dc=example,dc=com"  suffix          "dc=example,dc=com"
Line 54: Line 54:
 directory      /var/lib/openldap-data  directory      /var/lib/openldap-data
 index          objectClass    eq  index          objectClass    eq
 + 
 TLSCertificateFile /etc/openldap/ssl/ldap.pem  TLSCertificateFile /etc/openldap/ssl/ldap.pem
 TLSCertificateKeyFile /etc/openldap/ssl/ldap.key  TLSCertificateKeyFile /etc/openldap/ssl/ldap.key
Line 61: Line 61:
:include|このサーバで使用するスキーマを指定いたします。 :include|このサーバで使用するスキーマを指定いたします。
:moduleload|サーバで使用する機能のエクステンションモジュールを指定します。 :moduleload|サーバで使用する機能のエクステンションモジュールを指定します。
-:access to|データにアクセスする際の権限。アクセスリストを指定します。これは、[[LDAPアクセスリスト設定>Gentoo Linuxな生活/LDAPアクセスリスト設定]]で詳しく記載します。+:access to|データにアクセスする際の権限。アクセスリストを指定します。これは、[[LDAPのセキュリティ設定>Gentoo Linuxな生活/LDAPのセキュリティ設定]]で詳しく記載します。
:database|LDAPで使用するDBバックエンドです。hdbはBerklayDBを指定しています。 :database|LDAPで使用するDBバックエンドです。hdbはBerklayDBを指定しています。
:suffix|ツリーの起点となるドメイン名を指定します。example.comはdc=example,dc=comと文節ごとに分けて記載します。LDAPの記載ルールです。 :suffix|ツリーの起点となるドメイン名を指定します。example.comはdc=example,dc=comと文節ごとに分けて記載します。LDAPの記載ルールです。
Line 68: Line 68:
:index|データベース検索を高速化するために作成するインデックスの種別を指定します。ここだと、objectClassのインデックスを指定しています。 :index|データベース検索を高速化するために作成するインデックスの種別を指定します。ここだと、objectClassのインデックスを指定しています。
:TLSXXX|SSLトランスポート用のサーバ証明書/秘密鍵を指定します。 :TLSXXX|SSLトランスポート用のサーバ証明書/秘密鍵を指定します。
 +
**ldap.conf [#u5c010f4] **ldap.conf [#u5c010f4]
続いて、/etc/openldap/ldap.confを設定します。LDAPクライアントツール用の設定です。 続いて、/etc/openldap/ldap.confを設定します。LDAPクライアントツール用の設定です。
Line 73: Line 74:
 # LDAP Defaults  # LDAP Defaults
 #  #
 + 
 # See ldap.conf(5) for details  # See ldap.conf(5) for details
 # This file should be world readable but not world writable.  # This file should be world readable but not world writable.
 + 
 BASE    dc=example,dc=com  BASE    dc=example,dc=com
 URI    ldap://foo.example.com  URI    ldap://foo.example.com
 + 
 TLS_CACERT /etc/openldap/ssl/ldap.pem  TLS_CACERT /etc/openldap/ssl/ldap.pem
 TLS_REQCERT allow  TLS_REQCERT allow
Line 97: Line 98:
 # /etc/init.d/slapd start  # /etc/init.d/slapd start
-*サーバにデータをぶち込む [#h993c4ab] +*既存データのマイグレーション [#o297dda8]
-**既存データのマイグレーション [#o297dda8]+
ここでは、Linuxにすでに設定されている認証用データ(passwd/shadow/group/hosts)のデータをLDAPに登録することを考えます。 ここでは、Linuxにすでに設定されている認証用データ(passwd/shadow/group/hosts)のデータをLDAPに登録することを考えます。
[[MigrationTools>http://www.padl.com/download/MigrationTools.tgz]]をダウンロードしてきまして、解凍したします。解凍したディレクトリに移り、migrate_common.plを編集いたします。 [[MigrationTools>http://www.padl.com/download/MigrationTools.tgz]]をダウンロードしてきまして、解凍したします。解凍したディレクトリに移り、migrate_common.plを編集いたします。
Line 115: Line 115:
そして/tmp配下に吐き出したldifファイルを以下のコマンドでLDAPサーバにインポートします。 そして/tmp配下に吐き出したldifファイルを以下のコマンドでLDAPサーバにインポートします。
- # ldapadd -D "cn=Manager,dc=example,dc=com" -W -f <template_file>+ # ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f <template_file>
きちんとインポートされたかどうかは、以下のコマンドで確認できます。 きちんとインポートされたかどうかは、以下のコマンドで確認できます。
- # ldapsearch -D "cn=Manager,dc=example,dc=com" -W+ # ldapsearch -x -D "cn=Manager,dc=example,dc=com" -W
これでサーバの準備ができました♪ これでサーバの準備ができました♪
  Next »[4]