home ホーム search 検索 -  login ログイン  | reload edit datainfo version cmd icon diff delete  | help ヘルプ

日記/2005/05/08/DefaultRoot(chrootによるディレクトリ移動制限)の罠:ProFTPD

日記/2005/05/08/DefaultRoot(chrootによるディレクトリ移動制限)の罠:ProFTPD

日記 / 2005 / 05 / 08 / DefaultRoot(chrootによるディレクトリ移動制限)の罠:ProFTPD
id: 323 所有者: msakamoto-sf    作成日: 2005-05-08 20:32:34
カテゴリ: FTP 

いやー・・・。やられた。罠にはまった。
ProFTPDで、ログインユーザーのルートディレクトリを制限(chroot)するための指示子、DefaultRootですが、ず~~~~~っと勘違いしてました。
たとえば、webmasterとmemberグループに対して~/public_htmlに制限するために、こんな風にしてました。

DefaultRoot ~/public_html webmaster, member

・・・動かないんですよ。これ、よ~~~~っくProFTPDのDefaultRootドキュメントを読めばすぐ解るんです。
http://www.proftpd.org/docs/directives/linked/config_ref_DefaultRoot.html

引用:

The optional group-expression argument can be used to restrict
the DefaultRoot directive to a unix group, groups or subset of groups.
The expression takes the format: [!]group-name1[,[!]group-name2[,...]].
The expression is parsed in alogical boolean AND fashion, such that each
member of the expression must evaluate to logically TRUE in order for
the DefaultRoot directive to apply.
The special character '!' is used to negate group membership.

・・・そう。グループ部分は全てAND結合されてチェックされるわけです。ということは、結局これだと「web_masterかつmemberグループ」ということになり、片方だけじゃそもそも無理と言うことです。

では、どちらか一方なら適用させる。というふうにはどうすればいいのか?
http://www.proftpd.org/docs/faq/linked/faq-ch5.html
ここのDefaultRootで検索した項から引用するが、

You can usemultipleDefaultRoot directives to create multiple jails
inside the same directive context.

とのこと。

結論から言うと、今回の例であればこのように二つに分ければ良いことになる。

DefaultRoot ~/public_html web_master
DefaultRoot ~/public_html member

プレーンテキスト形式でダウンロード
現在のバージョン : 1
更新者: msakamoto-sf
更新日: 2009-04-05 20:35:31
md5:4e7c85d6a35cf2a0f45ed637a26bf68c
sha1:83bba0ca5821c6b39b66aa03fc6b05711b2b537f
コメント
コメントを投稿するにはログインして下さい。