LinuxSir.cn,穿越时空的Linuxsir!

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

vsftpd 的匿名目录访问权限问题。

[复制链接]
发表于 2006-3-26 12:44:03 | 显示全部楼层 |阅读模式
就是以 anonymous 登录后 所在的那个目录,到底应该是用什么权限才能满足读取?

比如
vsftpd:x:47:47:vsFTPD User:/dev/null:/bin/false
ftp:x:45:45:ftp_anonymous:/home/ftp:/bin/false

我要 /home/ftp 这个目录的权限是 550 (不是 555)的话,要用哪个 user:group 才能列出里边的内容?我就是不想以 other身份 来访问。

我试过了 ftp,vsftpd,nobody 三种,循环作 user 和group,都不行。那倒是是要哪个才行?

权限设置为 550 后,访问的结果

  1. $ ftp localhost
  2. Connected to localhost.
  3. 220 (vsFTPd 2.0.4)
  4. Name (localhost:william): ftp
  5. 331 Please specify the password.
  6. Password:
  7. 230 Login successful.
  8. Remote system type is UNIX.
  9. Using binary mode to transfer files.
  10. ftp> ls
  11. 200 PORT command successful. Consider using PASV.
  12. 150 Here comes the directory listing.
  13. [color="Red"]226 Transfer done (but failed to open directory).[/color]
  14. ftp>
复制代码


权限为 555 的时候的结果。

  1. ftp> ls
  2. 200 PORT command successful. Consider using PASV.
  3. 150 Here comes the directory listing.
  4. -rw-r--r--    1 0        0               0 Mar 26 03:08 home_ftp
  5. drwxr-xr-x    2 0        0              96 Mar 26 04:31 incoming
  6. 226 Directory send OK.
复制代码


配置文件

  1. listen=YES
  2. background=YES
  3. nopriv_user=vsftpd
  4. secure_chroot_dir=/var/ftp/empty
  5. anon_root=/home/ftp
  6. anonymous_enable=YES
  7. local_enable=YES
  8. write_enable=YES
  9. local_umask=022
  10. anon_upload_enable=YES
  11. anon_mkdir_write_enable=YES
  12. dirmessage_enable=YES
  13. xferlog_enable=YES
  14. connect_from_port_20=YES
  15. nopriv_user=vsftpd
  16. chroot_local_user=YES
  17. chroot_list_enable=YES
  18. chroot_list_file=/etc/vsftpd.chroot_list
复制代码
 楼主| 发表于 2006-3-26 16:35:47 | 显示全部楼层
anon_world_readable_only=NO

加入这个,用户用 ftp 就可以了。

原来是要规定 worldreadable 的。
回复 支持 反对

使用道具 举报

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

本版积分规则

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