我的网站上有一些目录我希望匿名的ftp用户可以访问这些目录但是它们不应该是可见的。因此我不希望它们在输入“ls”或“dir”时出现,但我希望用户能够输入“cd secret_dir”。
我希望这样做
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拥有这些文件。我无法更改任何这些权限,因为它们将由另一个创建目录的应用程序设置。目录的权限如下所示:
sskanberg@ubuntu-develop:/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
所以我的问题是:如何在Directory标签中使用正则表达式?或者,我怎样才能以其他方式实现我的愿望:让ftp用户看不到目录,但仍然能够进入这些目录?
答案 0 :(得分: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>