2011-11-14 6 views
3

自分のサイトにいくつかのディレクトリがあります。匿名のftpユーザーがアクセスできるようにしたいが、表示しないでください。ですから、 "ls"や "dir"と入力したときにそれらを表示させたくないのですが、ユーザに "cd secret_dir"と入力できるようにしたいのです。proftpdのディレクトリパスに正規表現を使用する方法

私は、これは

ServerName    "ProFTPD Default Installation" 
ServerType    standalone 
DefaultServer   on 
Port    21 
Umask    022 
MaxInstances   30 

# Set the user and group under which the server will run. 
User    nobody 
Group    nogroup 

RequireValidShell   off 

# Normally, we want files to be overwriteable. 
<Directory /> 
    AllowOverwrite   on 
</Directory> 

<Anonymous /home/ftp/my.site.org> 
    User    ftp 
    Group    planonline 

    UserAlias    anonymous ftp 
    MaxClients   10 

    DisplayLogin   welcome.msg 
    DisplayChdir   .message 

    # So users can't do ls in the directory 
    <Limit ALL> 
    DenyAll 
    </Limit> 

    # All have access to this directory, for testing permissions 
    <Directory "/home/ftp/my.site.org/uuid-files/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000"> 
    <Limit ALL> 
    AllowAll 
    </Limit> 
    </Directory> 

    # I want this to work but it doesn't 
    <Directory "/home/ftp/my.site.org/uuid-files/[0-9a-f]"> 
    <Limit ALL> 
     AllowAll 
    </Limit> 
    </Directory> 
</Anonymous> 

ユーザーFTPとファイルを所有planonlineグループを行うだろう期待していました。ディレクトリを作成する別のアプリケーションによってそのように設定されるため、これらのアクセス許可を変更することはできません。ディレクトリのアクセス許可は次のようになります。

[email protected]:/home/ftp$ ls -l 
total 8 
-rwxr--r-- 1 ftp planonline 4 2011-11-14 13:15 ftpdir.txt 
drwxrwxr-- 3 ftp planonline 4096 2011-11-14 13:08 my.site.org 

私のディレクトリタグにはどのように正規表現を使用できますか?あるいは、他の方法で私の望みを達成するにはどうしたらよいですか?ftpユーザーにとってディレクトリを見えなくしても、引き続きcd'inできますか?

答えて

0

HideFilesを試しましたか?私はそれがこのように使用されるべきだと思います:

<Directory "/home/ftp/my.site.org/uuid-files"> 
    HideFiles ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$ 
    <Limit ALL> 
    AllowAll 
    IgnoreHidden on 
    </Limit> 
</Directory> 
関連する問題