ftp文件夹的结构如下:
/home/ftp
├── share
├── user1
└── user2
user有很多,假定一直到user100
希望做到
1.任何用户都可以使用share文件夹,下载文件,不可以上传。
2.任何用户只可以看他本人的文件夹,user1只可以看/home/ftp/user1 .
如何写配置文件?希望懂vsftpd 和proftpd的大侠来赐教,这两个文件的配置基本一致。
谢谢。
如何写配置文件?
-
- 帖子: 137
- 注册时间: 2015-07-24 8:29
- 系统: ubuntu
Re: 如何写配置文件?
我找到了办法
DefaultRoot /home/ftp
<Directory /home/ftp/share/*>
<Limit ALL>
AllowAll
</Limit>
</Directory>
<Directory /home/ftp/user1/*>
<Limit ALL>
AllowUser user1
DenyALL
</Limit>
</Directory>
<Directory /home/ftp/user2/*>
<Limit ALL>
AllowUser user2
DenyALL
</Limit>
</Directory>
这样问题暂时解决了。
引申一下,问题大了。且看:
一个老师带了100个学生,架设了ftp服务器,每个学生分配了一个帐号(就是他的学号),密码,一块空间/home/ftp/学号 用来上传他自己的作业。
为了让每个学生不看见别人上传的作业,必须进行上面的那种设置,/home/ftp/share是老师发布的资料,为说有学生共享。
按照上面的思路,应当这样写配置文件
DefaultRoot /home/ftp
<Directory /home/ftp/share/*>
<Limit ALL>
AllowAll
</Limit>
</Directory>
<Directory /home/ftp/user1/*>
<Limit ALL>
AllowUser user1
DenyALL
</Limit>
</Directory>
<Directory /home/ftp/user2/*>
<Limit ALL>
AllowUser user2
DenyALL
</Limit>
</Directory>
中间雷同的省略。
<Directory /home/ftp/user100/*>
<Limit ALL>
AllowUser user100
DenyALL
</Limit>
</Directory>
这种办法也太笨拙了吧。
DefaultRoot /home/ftp
<Directory /home/ftp/share/*>
<Limit ALL>
AllowAll
</Limit>
</Directory>
<Directory /home/ftp/user1/*>
<Limit ALL>
AllowUser user1
DenyALL
</Limit>
</Directory>
<Directory /home/ftp/user2/*>
<Limit ALL>
AllowUser user2
DenyALL
</Limit>
</Directory>
这样问题暂时解决了。
引申一下,问题大了。且看:
一个老师带了100个学生,架设了ftp服务器,每个学生分配了一个帐号(就是他的学号),密码,一块空间/home/ftp/学号 用来上传他自己的作业。
为了让每个学生不看见别人上传的作业,必须进行上面的那种设置,/home/ftp/share是老师发布的资料,为说有学生共享。
按照上面的思路,应当这样写配置文件
DefaultRoot /home/ftp
<Directory /home/ftp/share/*>
<Limit ALL>
AllowAll
</Limit>
</Directory>
<Directory /home/ftp/user1/*>
<Limit ALL>
AllowUser user1
DenyALL
</Limit>
</Directory>
<Directory /home/ftp/user2/*>
<Limit ALL>
AllowUser user2
DenyALL
</Limit>
</Directory>
中间雷同的省略。
<Directory /home/ftp/user100/*>
<Limit ALL>
AllowUser user100
DenyALL
</Limit>
</Directory>
这种办法也太笨拙了吧。