LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 893|回复: 2

proftpd改变匿名和本地用户登陆目录的问题

[复制链接]
发表于 2006-7-31 00:08:16 | 显示全部楼层 |阅读模式
/home/ftp/download , /home/ftp/upload
现在想让匿名用户登陆后对/home/ftp/只有read权限
而本地用户(需密码)登陆在/home/ftp/upload,并有write权限
我的proftpd.conf:
  1. # This is a basic ProFTPD configuration file (rename it to
  2. # 'proftpd.conf' for actual use.  It establishes a single server
  3. # and a single anonymous login.  It assumes that you have a user/group
  4. # "nobody" and "ftp" for normal operation and anon.

  5. CharsetLocal           UTF-8
  6. CharsetRemote        GBK
  7. ServerName                      "ProFTPD Default Installation"
  8. ServerType                      standalone
  9. DefaultServer                   on
  10. DefaultRoot ~
  11. # Port 21 is the standard FTP port.
  12. Port                            21

  13. # Umask 022 is a good standard umask to prevent new dirs and files
  14. # from being group and world writable.
  15. Umask                           022

  16. # To prevent DoS attacks, set the maximum number of child processes
  17. # to 30.  If you need to allow more than 30 concurrent connections
  18. # at once, simply increase this value.  Note that this ONLY works
  19. # in standalone mode, in inetd mode you should use an inetd server
  20. # that allows you to limit maximum number of processes per service
  21. # (such as xinetd).
  22. MaxInstances                    30

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

  26. # To cause every FTP user to be "jailed" (chrooted) into their home
  27. # directory, uncomment this line.
  28. #DefaultRoot ~

  29. # Normally, we want files to be overwriteable.
  30. AllowOverwrite          on

  31. # Bar use of SITE CHMOD by default
  32. <Limit SITE_CHMOD>
  33.   DenyAll
  34. </Limit>

  35. # A basic anonymous configuration, no upload directories.  If you do not
  36. # want anonymous users, simply delete this entire <Anonymous> section.
  37. <Anonymous /home/ftp/>
  38.   User                          ftp
  39.   Group                         ftp

  40.   # We want clients to be able to login with "anonymous" as well as "ftp"
  41.   UserAlias                     anonymous ftp

  42.   # Limit the maximum number of anonymous logins
  43.   MaxClients                    10

  44.   # We want 'welcome.msg' displayed at login, and '.message' displayed
  45.   # in each newly chdired directory.
  46.   DisplayLogin                  welcome.msg
  47.   DisplayFirstChdir             .message

  48.   # Limit WRITE everywhere in the anonymous chroot
  49.   <Limit WRITE>
  50.     DenyAll
  51.   </Limit>
  52. </Anonymous>
  53. ########下面是我加的
  54. <Anonymous /home/ftp/upload>
  55. User upload
  56. Group upload
  57. <Limit WRITE>
  58. AllowUser upload
  59. DenyAll
  60. </Limit>
  61. </Anonymous>
复制代码


ftp和upload的home目录是:
ftp:x:1001:100::/var/ftp/download:/sbin/nologin
upload:x:1002:100::/var/ftp/upload/:/sbin/nologin
现在ftp能正常匿名登陆到/home/ftp/
但是upload却总是登陆在/var/ftp/upload
也就是说<Anonymous /home/ftp/upload>对upload不起作用
我只要把upload的home目录改成/home/ftp/upload就能满足我的要求,但还是想知道下原因,望高人指教。
发表于 2006-8-2 08:32:50 | 显示全部楼层
本地用户缺省是登录到自己的家目录的

而匿名用户有些特殊,因为不是一个系统用户,所以可以设置他的家目录,与实际系统中作为匿名用户的实际用户的家目录无关。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-8-2 12:21:17 | 显示全部楼层
Post by springwind426
本地用户缺省是登录到自己的家目录的

而匿名用户有些特殊,因为不是一个系统用户,所以可以设置他的家目录,与实际系统中作为匿名用户的实际用户的家目录无关。

谢谢春风啊,我发现我的好几个服务器的问题都是你来解答的,呵呵
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表