07 6月 2009 @ 11:52 PM 

ドメイン0を認証サーバにするためにLDAPサーバを立てる。
OpenLDAPはDebianだとslapdパッケージになる。
とりあえず今回は認証機構にはpamを用いるのを目標にする。

インストールするパッケージは以下。

  • slapd
  • ldap-utils
  • libnss-ldap
  • libpam-ldap

まず、slapdを設定。

# grep ^[^#] /etc/ldap/slapd.conf
include         /etc/ldap/schema/core.schema
include         /etc/ldap/schema/cosine.schema
include         /etc/ldap/schema/nis.schema
include         /etc/ldap/schema/inetorgperson.schema
pidfile         /var/run/slapd/slapd.pid
argsfile        /var/run/slapd/slapd.args
loglevel        none
modulepath      /usr/lib/ldap
moduleload      back_hdb
sizelimit 500
tool-threads 1
backend         hdb
database        hdb
suffix          "dc=waterblue,dc=net"
rootdn          "cn=admin,dc=waterblue,dc=net"
directory       "/var/lib/ldap"
dbconfig set_cachesize 0 2097152 0
dbconfig set_lk_max_objects 1500
dbconfig set_lk_max_locks 1500
dbconfig set_lk_max_lockers 1500
index           objectClass eq
lastmod         on
checkpoint      512 30
access to attrs=userPassword,shadowLastChange
        by anonymous auth
        by self write
        by * none
access to dn.base="" by * read
access to *
        by * read

ldap-utilの設定。

/etc/ldap/ldap.conf

BASE    dc=waterblue,dc=net
HOST    127.0.0.1

次にnsswitch.confでLDAPを参照出きるようにするためだけのようなlibnss-ldapの設定。

# grep ^[^#] /etc/libnss-ldap.conf
host 127.0.0.1
base dc=waterblue,dc=net
ldap_version 3
rootbinddn cn=admin,dc=waterblue,dc=net

/etc/nsswitch.confでldapを参照するように設定を変える。

passwd:         compat ldap
group:          compat ldap
shadow:         compat ldap

libpam-ldapの設定。

# grep ^[^#] /etc/pam_ldap.conf
host 127.0.0.1
base dc=waterblue,dc=net
ldap_version 3
rootbinddn cn=admin,dc=waterblue,dc=net

あとはpamの設定でLDAPを使うように/etc/pam.d/以下を編集することになる。

/etc/pam.d以下のcommon系ファイルを書き換える。

common-account

account sufficient      pam_ldap.so
account required        pam_unix.so try_first_pass

common-auth

auth    sufficient      pam_ldap.so
auth    required        pam_unix.so nullok_secure use_first_pass

common-password

password   sufficient pam_ldap.so
password   required   pam_unix.so nullok obscure md5 use_first_pass

これで認証でldapが利用される。


Posted By: ゆ。
Last Edit: 14 6月 2009 @ 09:59 AM

EmailPermalink
Tags
Tags: , ,
Categories: Linux, PC


 

Responses to this post » (One Total)

 
  1. [...] 相方が携帯紛失 named by orz  14 6月 2009 @ 2:51 AM   SambaとLDAP連携  Easy AdSense by Unreal結局Samba4のActive Directory+LDAPの統一認証機構は諦めて、ひとまずSamba3系でLDAP認証統合をしようと思った。 ということで、インストール開始。 なお、LDAPとPAMの連携はできているものとする。 やり方はこちらのエントリ参照。 [...]

Post a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


 Last 50 Posts
 Back
Change Theme...
  • Users » 100
  • Posts/Pages » 314
  • Comments » 177
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight