免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3139 | 回复: 3
打印 上一主题 下一主题

[FTP] proftpd目录权限配置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-11-01 15:26 |只看该作者 |倒序浏览
各位好!

现在我的应用需求是这样的:
FTP根目录下有a,b,c三个目录,每个目录下均有1,2,3,4,5....子目录
有若干个ftp账号:user1,user2,...

user1账号可以访问a,b,c目录下的任意子目录,包括上传,下载,删除
user2账号仅可以访问a,b,c目录下的1,2,3子目录,不能访问其他子目录,如4,5等(必要时可隐藏4,5等子目录)

请问proftpd可以做到吗?如何做?

如果proftpd不能做到,麻烦推荐一款linux下的免费ftp服务软件,谢谢了!

PS: vsftpd试过了,里面的deny_file和hide_file功能太弱了,不能满足要求。

论坛徽章:
0
2 [报告]
发表于 2012-11-01 15:37 |只看该作者
这是我的proftpd.conf,<Directory>下的<Limit>不能生效,具体表现为:
/var/ftp/pub为a+w时,user1,user2用户均能写入,当/var/ftp/pub为o-w,g-w时,两用户均无法写入。
/var/ftp/pub属主为ftp:ftp
  1. ServerName                        "ProFTPD server"
  2. ServerIdent                        off
  3. ServerAdmin                        root@localhost
  4. DefaultServer                        on
  5. VRootEngine                        on
  6. DefaultRoot                        /var/ftp !adm
  7. VRootAlias                        etc/security/pam_env.conf /etc/security/pam_env.conf
  8. AuthUserFile                    /etc/proftpd/ftpd.passwd
  9. AuthGroupFile                   /etc/proftpd/ftpd.group
  10. AuthPAMConfig                        proftpd
  11. AuthOrder                        mod_auth_unix.c mod_auth_file.c
  12. UseReverseDNS                        off
  13. User                                ftp
  14. Group                                ftp
  15. MaxInstances                        20
  16. UseSendfile                        off
  17. LogFormat                        ALL        "%h %l %u %t \"%r\" %s %b"
  18. LogFormat                        auth        "%v [%P] %h %t \"%r\" %s"
  19. <IfDefine TLS>
  20.   TLSEngine                        on
  21.   TLSRequired                        on
  22.   TLSRSACertificateFile                /etc/pki/tls/certs/proftpd.pem
  23.   TLSRSACertificateKeyFile        /etc/pki/tls/certs/proftpd.pem
  24.   TLSCipherSuite                ALL:!ADH:!DES
  25.   TLSOptions                        NoCertRequest
  26.   TLSVerifyClient                off
  27.   #TLSRenegotiate                ctrl 3600 data 512000 required off timeout 300
  28.   TLSLog                        /var/log/proftpd/tls.log
  29.   <IfModule mod_tls_shmcache.c>
  30.     TLSSessionCache                shm:/file=/var/run/proftpd/sesscache
  31.   </IfModule>
  32. </IfDefine>
  33. <IfDefine DYNAMIC_BAN_LISTS>
  34.   LoadModule                        mod_ban.c
  35.   BanEngine                        on
  36.   BanLog                        /var/log/proftpd/ban.log
  37.   BanTable                        /var/run/proftpd/ban.tab
  38.   # If the same client reaches the MaxLoginAttempts limit 2 times
  39.   # within 10 minutes, automatically add a ban for that client that
  40.   # will expire after one hour.
  41.   BanOnEvent                        MaxLoginAttempts 2/00:10:00 01:00:00
  42.   # Allow the FTP admin to manually add/remove bans
  43.   BanControlsACLs                all allow user ftpadm
  44. </IfDefine>
  45. <Limit SITE_CHMOD>
  46.         DenyAll
  47. </Limit>
  48. <Limit LOGIN>
  49.         AllowUser user1,user2
  50.         AllowGroup virtual
  51.         DenyAll
  52. </Limit>
  53. <Directory /var/ftp/pub>
  54.         <Limit READ>
  55.         AllowAll
  56.         </Limit>
  57.         <Limit WRITE DELE MKD RNFR>
  58.         AllowUser user1
  59.         DenyAll
  60.         </Limit>
  61. </Directory>
  62. <Directory /var/ftp/pub/*>
  63.         <Limit READ>
  64.         AllowAll
  65.         </Limit>
  66.         <Limit WRITE DELE MKD RNFR>
  67.         AllowUser user1
  68.         DenyAll
  69.         </Limit>
  70. </Directory>
  71. <Global>
  72.   # Umask 022 is a good standard umask to prevent new dirs and files
  73.   # from being group and world writable
  74.   Umask                                022
  75.   # Allow users to overwrite files and change permissions
  76.   AllowOverwrite                yes
  77. </Global>
  78. <Anonymous /var/ftp>
  79.           User                          ftp
  80.           Group                         ftp
  81.           UserAlias                     anonymous ftp
  82.           UserAlias                     guest ftp
  83.           MaxClients                    10
  84.           <Directory *>
  85.             <Limit WRITE>
  86.               DenyAll
  87.             </Limit>
  88.           </Directory>
  89.           <Directory /var/ftp/Incoming>
  90.             Umask                       002
  91.             <Limit STOR>
  92.               AllowAll
  93.             </Limit>
  94.             <Limit READ>
  95.               DenyAll
  96.             </Limit>
  97.           </Directory>
  98. </Anonymous>
复制代码

论坛徽章:
0
3 [报告]
发表于 2012-11-01 15:39 |只看该作者
UP
UP
UP
up

论坛徽章:
0
4 [报告]
发表于 2012-11-05 11:15 |只看该作者
为什么没有人回答啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP