2009年04月09日

今更聞けない?こともないかな・・・ldap基本コマンドを復習する

自分のための覚書として、記しておくことにします。

おそらく、実務では、直接コマンドを叩くことは、
ないと思いますけど。

■Fedora 10
 OpenLDAP

■追加インストール

yum -y install openldap-servers

yum -y install openldap-servers-sql

下記は、なくてもいいけど。
yum -y install python-ldap compat-openldap


■ldapの基本コマンド

ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f init.ldif

ldapsearch -x -D 'cn=Manager,dc=example,dc=com' -W -b '' '(objectclass=*)'

ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts


ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f jack.ldif

ldapdelete -x -D 'cn=Manager,dc=example,dc=com' -W cn=Jack,ou=People,dc=example,dc=com


■かなり濃い本だと今頃気づきました。
 このデージーネットの社長さんは、すごい人なんでしょう。
 一連の書籍は、すごく実務的な内容ばかりです。

 実際の仕事で構築してきた内容を丁寧に書籍にされてます。

ldapopenldap.jpg


おすすめです。

中身は、濃いですよ。
posted by エル・マリアッチッチ at 00:11| OpenLDAPの基本 | このブログの読者になる | 更新情報をチェックする

2007年11月21日

OpenLDAPの入門書にも最適な本が発売!

暗号の本を買うつもりでいたんですが、
「LDAP」という文字が目に入り、
パラパラ見ていたら、

・内容的にも必要な箇所が記述されている

・sendmail・Postfixを初めとして
 実アプリケーションでのLDAP活用を
 具体的に書いている

上記2点が満たされているので
買いました。

ldapopenldap.jpg
■入門LDAP/OpenLDAP―ディレクトリサービス導入・運用ガイド
  価格:¥2,730(税込)
  出版社:秀和システム


1章と4章で、スキーマやオブジェクトクラス、
OID、属性、必須属性など、
LDAPの基本的な内容がカバーされているので、
学習書にも使えます。




posted by エル・マリアッチッチ at 17:41| オススメLDAP参考書籍 | このブログの読者になる | 更新情報をチェックする

2007年11月15日

OpenLDAPのパッケージを確認してみる(シーズン6)

荒:28行目から
  carLicense(自動車免許)とか
  部門ナンバーとか、従業員ナンバーなど
  人間に関係しそうな項目が出てきました。

大:attributetypeと書いているので、
  RADIUSのattributeを、思い出しますね。


# carLicense
# This multivalued field is used to record the values of the
# registration plate associated with an individual.
attributetype ( 2.16.840.1.113730.3.1.1
NAME 'carLicense'
DESC 'RFC2798: vehicle license or registration plate'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

# departmentNumber
# Code for department to which a person belongs. This can al
# strictly numeric (e.g., 1234) or alphanumeric (e.g., ABC/12
attributetype ( 2.16.840.1.113730.3.1.2
NAME 'departmentNumber'
DESC 'RFC2798: identifies a department within an orga
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )



大:138行目に、inetOrgPersonがあります。
  
荒:そうですね。

  ここを読むと、重要語句が
  目白押しです。

  必ず、読んだ方がいいです




# inetOrgPerson
# The inetOrgPerson represents people who are associated with an
# organization in some way. It is a structural class and is derived
# from the organizationalPerson which is defined in X.521 [X521].
objectclass ( 2.16.840.1.113730.3.2.2
NAME 'inetOrgPerson'
DESC 'RFC2798: Internet Organizational Person'
SUP organizationalPerson
STRUCTURAL
MAY (
audio $ businessCategory $ carLicense $ departmentNumber $
displayName $ employeeNumber $ employeeType $ givenName $
homePhone $ homePostalAddress $ initials $ jpegPhoto $
labeledURI $ mail $ manager $ mobile $ o $ pager $
photo $ roomNumber $ secretary $ uid $ userCertificate $
x500uniqueIdentifier $ preferredLanguage $
userSMIMECertificate $ userPKCS12 )
)



大:inetOrgPersonは、structual classだとか、
  X521で定義された organizationalPersonから
  生じた(派生した)とありますけど・・。

  ?

荒:structualは、
  オブジェクトクラスを表す用語なんです。

  オブジェクトクラスには、
  3種類あるので、必ず覚えておいて下さい。

1.structual オブジェクトクラス
  (構造型)
2.auxiliary オブジェクトクラス
  (補助)
3.abstract オブジェクトクラス
  (抽象)

大:日本語で「構造型」と覚えた方がいいですか?

荒:いやぁー、いらないと思うよ。

  日本語で覚えるより、structualでいいよ。

  英語ができない人、苦手な人でも
  structualで覚えた方が、いい。

大:もう、英語の時代ですもんねー。わーい(嬉しい顔)

荒:うん。大崎さんの時代だよ(^^)




posted by エル・マリアッチッチ at 10:57| OpenLDAPの基本 | このブログの読者になる | 更新情報をチェックする

OpenLDAPのパッケージを確認してみる(シーズン5)

大:/etc/openldap/schemaを開きますね。

  vi /etc/openldap/schema/inetorgperson.schema


荒:では、上から見ていきます。


1行目
# inetorgperson.schema -- InetOrgPerson (RFC2798)


荒:これは、RFC2798に定義されてますよ、と
  書かれています。

大:はい。

荒:次が大事なところです。

  depends uponと書かれてますね。

大:依存している、って意味ですね。

荒:はい。

  openldap-serversパッケージで
  一緒にインストールされたスキーマに
  core.schemaとcosine.schemaがありました。

  あの2つに、このinetorgperson.schemaが
  依存しているということになります。




18行目〜26行目
# Depends upon
# Definition of an X.500 Attribute Type and an Object Class to Hold
# Uniform Resource Identifiers (URIs) [RFC2079]
# (core.schema)
#
# A Summary of the X.500(96) User Schema for use with LDAPv3 [RFC2256]
# (core.schema)
#
# The COSINE and Internet X.500 Schema [RFC1274] (cosine.schema)



つづく・・・・
posted by エル・マリアッチッチ at 10:51| OpenLDAPの基本 | このブログの読者になる | 更新情報をチェックする

OpenLDAPのパッケージを確認してみる(シーズン4)

荒:openldap-serversパッケージから
 インストールされたファイルを見たところからです。

 その中に、schemaファイルがあります。

 一番重要なファイルです。

 schemaは、その発音通りに「スキーマ」と呼びます。

 これは、検索するために必要な要素(名前とか性とか電話番号とか)を
 あらかじめ用意した「枠組」です。


大:テンプレートみたいなイメージですか?

荒:そうですね。

  その方がイメージしやすいかもしれません。

大:テンプレートなので、何種類かあるということかぁー。

荒:見ないとわからないので、中身をのぞいてみましょう。

  まずは、inetorgperson.schemaを開けてみます。


つづく・・・・・


■推薦書籍

 まずは、11章をやりましょう。
 これなら、99%の人ができるはずです。

 できたら、includeしているschemaファイルは
 どうして、これを使っているのだろうと
 疑問がわいてくるはずです。

 そこからがLDAPのスタートです。


mkaizou.jpg


メールサーバ改造の教科書
 ―セキュリティを強化して多目的なメールサーバを構築


価格:¥2,730(税込)
出版社:秀和システム


ですので、この本を購入して
「まずは、これができた」という状態に
たどりつくのが先決です。

posted by エル・マリアッチッチ at 09:15| OpenLDAPの基本 | このブログの読者になる | 更新情報をチェックする

2007年11月14日

OpenLDAPのパッケージを確認してみる(シーズン3)

大:では、お願いします。

荒:さっさと終わって帰りましょう。

  わーい(嬉しい顔)

  続いて、LDAPサーバー本体のパッケージです。



# rpm -ql openldap-servers
/etc/openldap/DB_CONFIG.example
/etc/openldap/schema
/etc/openldap/schema/README
/etc/openldap/schema/corba.schema
/etc/openldap/schema/core.ldif
/etc/openldap/schema/core.schema
/etc/openldap/schema/cosine.schema
/etc/openldap/schema/dyngroup.schema
/etc/openldap/schema/inetorgperson.schema
/etc/openldap/schema/java.schema
/etc/openldap/schema/misc.schema
/etc/openldap/schema/nis.schema
/etc/openldap/schema/openldap.ldif
/etc/openldap/schema/openldap.schema
/etc/openldap/schema/ppolicy.schema
/etc/openldap/schema/redhat
/etc/openldap/schema/redhat/autofs.schema
/etc/openldap/slapd.conf
/etc/rc.d/init.d/ldap
/usr/lib/libslapd_db-4.4.so
/usr/lib/tls/i486
/usr/lib/tls/i486/libslapd_db-4.4.so
/usr/lib/tls/i586
/usr/lib/tls/i586/libslapd_db-4.4.so
/usr/lib/tls/i686
/usr/lib/tls/i686/libslapd_db-4.4.so
/usr/sbin/slapacl
/usr/sbin/slapadd
/usr/sbin/slapauth
/usr/sbin/slapcat
/usr/sbin/slapd
/usr/sbin/slapd_db_archive
/usr/sbin/slapd_db_checkpoint
/usr/sbin/slapd_db_deadlock
/usr/sbin/slapd_db_dump
/usr/sbin/slapd_db_hotbackup
/usr/sbin/slapd_db_load
/usr/sbin/slapd_db_printlog
/usr/sbin/slapd_db_recover
/usr/sbin/slapd_db_stat
/usr/sbin/slapd_db_upgrade
/usr/sbin/slapd_db_verify
/usr/sbin/slapdn
/usr/sbin/slapindex
/usr/sbin/slappasswd
/usr/sbin/slaptest
/usr/sbin/slurpd
/usr/share/doc/openldap-servers-2.3.27
/usr/share/doc/openldap-servers-2.3.27/README.migration
/usr/share/doc/openldap-servers-2.3.27/README.upgrading
/usr/share/doc/openldap-servers-2.3.27/TOOLS.migration
/usr/share/doc/openldap-servers-2.3.27/guide.html
/usr/share/man/man5/slapd-bdb.5.gz
/usr/share/man/man5/slapd-dnssrv.5.gz
/usr/share/man/man5/slapd-hdb.5.gz
/usr/share/man/man5/slapd-ldap.5.gz
/usr/share/man/man5/slapd-ldbm.5.gz
/usr/share/man/man5/slapd-ldif.5.gz
/usr/share/man/man5/slapd-meta.5.gz
/usr/share/man/man5/slapd-monitor.5.gz
/usr/share/man/man5/slapd-null.5.gz
/usr/share/man/man5/slapd-passwd.5.gz
/usr/share/man/man5/slapd-perl.5.gz
/usr/share/man/man5/slapd-relay.5.gz
/usr/share/man/man5/slapd-shell.5.gz
/usr/share/man/man5/slapd-sql.5.gz
/usr/share/man/man5/slapd-tcl.5.gz
/usr/share/man/man5/slapd.access.5.gz
/usr/share/man/man5/slapd.conf.5.gz
/usr/share/man/man5/slapd.plugin.5.gz
/usr/share/man/man5/slapd.replog.5.gz
/usr/share/man/man5/slapo-accesslog.5.gz
/usr/share/man/man5/slapo-auditlog.5.gz
/usr/share/man/man5/slapo-chain.5.gz
/usr/share/man/man5/slapo-dynlist.5.gz
/usr/share/man/man5/slapo-lastmod.5.gz
/usr/share/man/man5/slapo-pcache.5.gz
/usr/share/man/man5/slapo-ppolicy.5.gz
/usr/share/man/man5/slapo-refint.5.gz
/usr/share/man/man5/slapo-retcode.5.gz
/usr/share/man/man5/slapo-rwm.5.gz
/usr/share/man/man5/slapo-syncprov.5.gz
/usr/share/man/man5/slapo-translucent.5.gz
/usr/share/man/man5/slapo-unique.5.gz
/usr/share/man/man5/slapo-valsort.5.gz
/usr/share/man/man8/slapacl.8.gz
/usr/share/man/man8/slapadd.8.gz
/usr/share/man/man8/slapauth.8.gz
/usr/share/man/man8/slapcat.8.gz
/usr/share/man/man8/slapd.8.gz
/usr/share/man/man8/slapdn.8.gz
/usr/share/man/man8/slapindex.8.gz
/usr/share/man/man8/slappasswd.8.gz
/usr/share/man/man8/slaptest.8.gz
/usr/share/man/man8/slurpd.8.gz
/usr/share/openldap/migration
/usr/share/openldap/migration/README
/usr/share/openldap/migration/migrate_aliases.pl
/usr/share/openldap/migration/migrate_all_netinfo_offline.sh
/usr/share/openldap/migration/migrate_all_netinfo_online.sh
/usr/share/openldap/migration/migrate_all_nis_offline.sh
/usr/share/openldap/migration/migrate_all_nis_online.sh
/usr/share/openldap/migration/migrate_all_nisplus_offline.sh
/usr/share/openldap/migration/migrate_all_nisplus_online.sh
/usr/share/openldap/migration/migrate_all_offline.sh
/usr/share/openldap/migration/migrate_all_online.sh
/usr/share/openldap/migration/migrate_automount.pl
/usr/share/openldap/migration/migrate_base.pl
/usr/share/openldap/migration/migrate_common.ph
/usr/share/openldap/migration/migrate_fstab.pl
/usr/share/openldap/migration/migrate_group.pl
/usr/share/openldap/migration/migrate_hosts.pl
/usr/share/openldap/migration/migrate_netgroup.pl
/usr/share/openldap/migration/migrate_netgroup_byhost.pl
/usr/share/openldap/migration/migrate_netgroup_byuser.pl
/usr/share/openldap/migration/migrate_networks.pl
/usr/share/openldap/migration/migrate_passwd.pl
/usr/share/openldap/migration/migrate_profile.pl
/usr/share/openldap/migration/migrate_protocols.pl
/usr/share/openldap/migration/migrate_rpc.pl
/usr/share/openldap/migration/migrate_services.pl
/usr/share/openldap/migration/migrate_slapd_conf.pl
/usr/share/openldap/migration/migration-tools.txt
/usr/share/openldap/ucdata
/usr/share/openldap/ucdata/case.dat
/usr/share/openldap/ucdata/cmbcl.dat
/usr/share/openldap/ucdata/comp.dat
/usr/share/openldap/ucdata/ctype.dat
/usr/share/openldap/ucdata/decomp.dat
/usr/share/openldap/ucdata/kdecomp.dat
/usr/share/openldap/ucdata/num.dat
/var/lib/ldap
/var/run/openldap


荒:見てわかると思いますが、
  重要な設定ファイルが、たくさんあります。

  太赤字のところは
  次回、説明を付け加えますね。


大:はい。


つづく・・・・・・・



■推薦書籍

 とにかく、書籍の通りに設定して
 すぐにLDAPを動かしたい人向け、です。


mkaizou.jpg


メールサーバ改造の教科書
 ―セキュリティを強化して多目的なメールサーバを構築


価格:¥2,730(税込)
出版社:秀和システム


11章が、一番カンタンに、
確実に、LDAPサーバーの設定を行い、
かつメールクライアントソフトから
アドレスをLDAP検索で
探すことができます。

ldapsearchコマンドなども
即座に使えます。


初めて構築設定する人は、
無駄な時間を過ごさなくて
すむ本です。
posted by エル・マリアッチッチ at 19:21| OpenLDAPの基本 | このブログの読者になる | 更新情報をチェックする

2007年11月09日

Apache Directory StudioでLDAP接続(シーズン8)

Apache Directory Studioを起動して
Active Directoryの中身が見えました。


Apache Directory Studioの
インパクトは、すごかったんですが、
この1画面で、objectclass
Abstractなどを把握できるというのは
すごいことです。

adstu101.jpg


なんと見やすいことか!


ADSIEditやldap.exe、
RHDS・FDSのGUIツールや
phpLDAPAdminなどと比較しても、
圧倒的に見やすいと思います。


※RHDS・FDSは、
 冗長化などの機能設定もあるため、
 単純な比較はできませんが・・。


おそらく今後、
LDAPクライアントツール・管理ツールは
圧倒的に、Apache Directory Studioが
採り上げられることでしょう。




posted by エル・マリアッチッチ at 20:27| OpenLDAPとGUIツール | このブログの読者になる | 更新情報をチェックする

2007年11月08日

Apache Directory StudioでLDAP接続(シーズン7)

ウィザードの最後です。

adstu6_1.jpg



ここでは、特に、BaseDNを設定する必要も
ありません。

このまま、Finishボタンをクリックしましょう。

こういう画面が表示されましたか?

adstu100.jpg


次回からは、

Apache Directory Studioでスイスイ学ぶLDAP」が
スタートします。わーい(嬉しい顔)

お楽しみに。手(パー)



posted by エル・マリアッチッチ at 10:35| OpenLDAPとGUIツール | このブログの読者になる | 更新情報をチェックする

Apache Directory StudioでLDAP接続(シーズン6)

バインディングに関するクイズを出しましたが、
アクセス数している人の
2割くらいの人は、
即答できたのでは?と思います。


2003Serverで、ADSIEditを使い、
「わかった!」人を加えると、
半分くらいは、いるでしょうか・・・。


さて、回答です。

あくまで、一例ですが、
皆さん、これでしょうね。

adstu5_1.jpg


通常、ドメイン管理者である
administratorなら、
ADのデータベースを見る「アクセス権」が
あるはずです。

後は、
administratorのDN
答えることができれば、いいわけですね。

MCP試験ではありませんので、
記憶になくても、ADSIEditなどで
administratorが、
どこに存在するかを調べると
下記のように、すぐ見つかります。

adstu5_3.jpg

Domainコンテナを見れば、
administratorのDNも、一目瞭然ですよね。


administratorのパスワードを
入力し、念のため、
Check Authenticationボタンをクリックします。


成功すれば、下記が表示されます。

adstu5_1_1.jpg



■LDAPの参考書籍

 LDAP -設定・管理・プログラミング

 価格:¥4,410(税込)
 出版社:オーム社


ldap.jpg


structualやabstractやauxiliary、
mustやmay
について書かれています。

単一値属性や多値属性など、必須知識が
書かれています。



posted by エル・マリアッチッチ at 10:13| OpenLDAPとGUIツール | このブログの読者になる | 更新情報をチェックする

2007年11月07日

Apache Directory StudioでLDAP接続(シーズン5)

Nextボタンをクリックして
下記の画面が表示されていますよね?


adstu5.jpg


さて、ここで問題です。


問題「BIND DN or User テキストボックスに
   何を入力しますか?」



ヒント:この2003 Serverは
    ドメインコントローラーです。
    DNS・CAなどの役割も持っています。

    ドメイン名は、example.local です。


この問題は、
バインディングに関わる問題で
基本的な問題です。

ADSIEditやldap.exeなどで、
Active Directoryの中身を覗いたことの
ある人であれば、
わかると思います。


参考資料として、
このブログも見るといいかも(^^)
(書いているのは、私ですけど)

はじめての802.1x認証 http://8021x.seesaa.net/





つづく・・・・。

■参照書籍
 P28が参考になります。

 LDAPを企業に導入されるエンジニアは、必読本です。

ldap.jpg

LDAP -設定・管理・プログラミング

価格:¥4,410(税込)
出版社:オーム社

posted by エル・マリアッチッチ at 17:05| OpenLDAPとGUIツール | このブログの読者になる | 更新情報をチェックする

広告


この広告は60日以上更新がないブログに表示がされております。

以下のいずれかの方法で非表示にすることが可能です。

・記事の投稿、編集をおこなう
・マイブログの【設定】 > 【広告設定】 より、「60日間更新が無い場合」 の 「広告を表示しない」にチェックを入れて保存する。