LDAP+PAM+ProFTPDが動かない

SCSI RAIDカードが壊れたサーバLink の復旧で、CentOSLink を4.6から5.1に変更。ついでに一般ユーザー管理をLDAPに移行してしまおうと。以前からLDAPサーバは立ち上げてあったので移行はそれほど苦労しなかったのですが、ProFTPDLink がPAM+LDAP(pam_ldap.so)で認証してくれず、ログには no such user 'foo'と出る。

どうやらProFTPDは認証以外のユーザー名・UID・GIDといった情報を/etc/passwdから取っているらしい。今回それらの情報はLDAPに入れてあり/etc/passwdにはなかったのがエラーの原因で、/etc/passwdにも情報を入れると認証してくれる(/etc/shadowは不要)。だけどProFTPDのために/etc/passwdを復活させるのは本末転倒。

というわけで、ProFTPDを

./configure --with-modules=mod_ldap

でビルド。設定は/etc/openldap/slapd.conf
access to attrs=userPassword
        by self write
        by dn="cn=manager,dc=example,dc=com" write
        by anonymous auth
        by * none

access to *
        by self write
        by dn="cn=manager,dc=example,dc=com" write
        by * read
/usr/etc/proftpd.conf
AuthOrder       mod_ldap.c mod_auth_unix.c
LDAPServer      ldap.server
LDAPDoAuth      on "dc=example,dc=com"
などとします。ProFTPDソースのREADME.LDAPにはLDAPDNInfoの指定も書いてありますが、これではproftpd.confにLDAPのパスワード(何も考えないとmanagerの)を記述してしまうことになりますのでセキュリティ上良くない。上の設定のようにanonymousに
  • userPasswordをauthorizeできる
  • UID、GID、ホームのパスを読み出せる
ようLDAPサーバを設定したほうがいいでしょう。LDAPDNInfoを指定しなければ、ProFTPDはanonymousでパスワード認証をしにいきます。

— posted by mu at 08:56 pm   commentComment [0]  pingTrackBack [0]

T: Y: ALL: Online:
ThemeSwitch
  • Basic
Created in 0.0099 sec.
prev
2008.1
next
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31