config

  • 按以前的配置,只需要启用两项即可生效:
chroot_local_user=YES
local_enable=YES
  • 但后来出现不能chroot可写文件夹上。
ls: Login failed: 500 OOPS: vsftpd: refusing to run with writable root inside chroot()

chroot解决方法

  1. 开启chroot
  2. 设置chroot列表(在启用chroot的同时启用chroot列表,则chroot列表为不chroot的存在)
  3. 添加用户名进chroot列表
 93 # You may specify an explicit list of local users to chroot() to their home
 94 # directory. If chroot_local_user is YES, then this list becomes a list of
 95 # users to NOT chroot().
 96 # (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
 97 # the user does not have write access to the top level directory within the
 98 # chroot)
 99 chroot_local_user=YES
100 chroot_list_enable=YES
101 # (default follows)
102 chroot_list_file=/etc/vsftpd/vsftpd.chroot_list