SASL認証をLDAPに置換する。 anchor.png

SASL*1は、LDAP/Postfix/ipapデーモンなどの認証基盤となるライブラリです。メールを送信したり、メールを閲覧したりする際に、ユーザ、パスワード入力を要求されたりするときありますね。あれです。通常は、SASLもデータベース(sasldb)てのを持っていて、こちらにユーザ情報を登録しておくと認証ができます。

で、これをやめ、LDAPの情報を用いて認証するように変更いたします。そのためには、saslauthdというデーモンをかまし、postfix/cyrus-imapd→saslauthd→LDAPという順でアカウント情報を引くように設定いたします。

Page Top

saslauthdの設定 anchor.png

Page Top

/etc/saslauthd.conf anchor.png

/etc/saslauthd.confを以下のようなフォーマットで作成いたします。

ldap_servers: ldap://foo.example.com/
ldap_search_base: ou=People,dc=example,dc=example
ldap_bind_dn: cn=syncuser,dc=example,dc=example
ldap_password: secret

ここまでやってきたら、大体設定の意味は分かっているでしょう。ldaps://にするというのもいい手ですね。で、

Page Top

起動 anchor.png

saslauthdを起動します。ついでに自動起動も設定しておきますか。

# /etc/init.d/saslauthd start
# rc-update add saslauthd default
Page Top

postfixの設定 anchor.png

Page Top

/etc/sasl2/smtpd.conf anchor.png

/etc/sasl2/smtpd.confというファイルがあります。これは、postfixが、何を使用して認証するかを規定しています。以下のようにしてやりましょう。

pwcheck_method:saslauthd
mesh_list: LOGIN PLAIN CRAM-MD5 DIGEST-MD5 NTLM

あとは、SMTP-AUTH+Secure-IMAPで悩むの項で実施した内容がなされていればOK!で、再起動してやってあげてください。  # /etc/init.d/postfix restart

Page Top

cyrus-imapdの設定 anchor.png

Page Top

/etc/imapd.conf anchor.png

こいつの、以下の項目を設定します。

sasl_pwcheck_method:    saslauthd

以上おしまい。あとは、SMTP-AUTH+Secure-IMAPで悩むの項で実施した内容がなされていればOK!で、再起動してやってあげてください。

意外と簡単だったでしょ?SMTP-AUTHやIMAP-TLSが設定されてれば、認証基盤がsaslauthd経由LDAPになっただけで、使用感は全く変化ない、はずですよね。


*1 Simple Authentication and Security Layer

Front page   Freeze Diff Backup Copy Rename ReloadPrint View   New Page Page list Search Recent changes   Help   RSS of recent changes (RSS 1.0) RSS of recent changes (RSS 2.0) RSS of recent changes (RSS Atom) Powered by xpWiki
Counter: 5829, today: 2, yesterday: 0
Princeps date: 2011-01-08 (Sat) 20:31:19
Last-modified: 2011-01-08 (Sat) 20:33:00 (JST) (5130d) by maruo
ページ内検索

ログイン

ユーザー名:


パスワード:





パスワード紛失

メインメニュー

サブメニュー
自宅鯖計画

Gentoo Linuxな生活

玄箱HGにGentoo格闘記

航空ショーへ行こう

モータースポーツな世界

奥深き写真の世界への誘い

我思う ゆえに我あり



携帯用QRコード