ユーザ用ツール

サイト用ツール


サイドバー

Index

はじめてのおつかい






DokuWiki整形記法


PlayGround



serverapps:pure-ftpd:ldap

LDAPによるバーチャルユーザの設定

標準だと LDAPオプションがOFFなので注意

Pure-FTPdの設定

LDAPConfigFile を指定することで、ユーザ認証をLDAPで行います。
その他のオプションなど、詳しくはPure-FTPd オプションを参照。

# /usr/local/etc/pure-ftpd.conf

DisplayDotFiles NO
NoAnonymous YES
LDAPConfigFile /usr/local/etc/pureftpd-ldap.conf

LDAPの設定

LDAPサーバの用意については、こちら(Open LDAP)を参照してください。

スキーマの準備

Pure-ftpdは独自のスキーマが用意されていますので、これを利用します。
スキーマは /usr/local/share/doc/pure-ftpd/pureftpd.schema です。
これを、LDAPサーバの /usr/local/etc/openldap/schema にコピーします。

スキーマの登録

/usr/local/etc/openldap/slapd.conf に以下の行を追加

include         /usr/local/etc/openldap/schema/pureftpd.schema

LDAPの再起動

# /usr/local/etc/rc.d/slapd restart

Pure-FTPdのLDAP設定

設定ファイルは、pure-ftpd.confのLDAPConfigFileで設定した /usr/local/etc/pureftpd-ldap.conf

主な設定項目は以下の通り。

設定項目概要
LDAPServerLDAPサーバの名前 or IP
LDAPPortLDAPのポート
LDAPBaseDNベースDN。ここを起点に検索される
LDAPBindDNLDAP接続ユーザ
LDAPBindPWパスワード
LDAPDefaultUID指定がない場合のUID
LDAPDefaultGID指定がない場合のGID
LDAPFilter検索フィルタ
LDAPHomeDirホームディレクトリが格納されているLDAP属性名

バーチャルユーザの設定

LDAP上に仮想ユーザのエントリーを作成します。

設定例:

dn: uid=testuser,ou=ftp,dc=my-domain,dc=com
objectClass: PureFTPdUser
objectClass: account
objectClass: simpleSecurityObject
uid: testuser
FTPhomeDirectory: /home/ftp/testuser
userPassword: {SSHA} u00s00e00r00P00a00s00s00w00o00r00d
FTPgid: 1000
FTPuid: 1000

なお、FTPhomeDirectoryは標準ではpureftpdのスキーマにはありませんので、自分で追加しています。

serverapps/pure-ftpd/ldap.txt · 最終更新: 2017/06/28 20:44 by hayashi