遇到的坑

限制用户到其用户主目录,不允许访问上级或其他系统目录。

更改vsftpd.conf文件:

  1. # You may restrict local users to their home directories. See the FAQ for
  2. # the possible risks in this before using chroot_local_user or
  3. # chroot_list_enable below.
  4. #
  5. # chroot_local_user=YES # 我去注意下面的chroot_list与之搭配则作用相反。。
  6. # allow_writeable_chroot=YES
  7. #
  8. # You may specify an explicit list of local users to chroot() to their home
  9. # directory. If chroot_local_user is YES, then this list becomes a list of
  10. # users to NOT chroot().
  11. # (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
  12. # the user does not have write access to the top level directory within the
  13. # chroot)
  14. # allow_writeable_chroot=YES
  15. chroot_list_enable=YES
  16. # (default follows)
  17. chroot_list_file=/etc/vsftpd.chroot_list

注意,此时vsftpd.chroot_list文件中的用户不应该有写权限?