VSFTP设置,我希望用户不要进入其他目录,然后他们/家。 我已经设置:
chroot_local_user=YES
但似乎没有工作(重新启动后)。
难道是我有错误的configuration文件? 还是有其他设置或login方式,跳过此configuration行?
编辑 :与其他人一起,我发现vsftp根本就不在监听端口的服务器。因此,我没有看到我的变化反映出来。 从而解决了这个问题。
不过,下面的答案可能会解决这个问题。
你有启用chroot_list_enable选项吗? 如果是这样, chroot_list_file列出的任何用户将不会被chroot。
我认为其中的一部分是多余的,但是我没有回头去捅它,因为它是有效的。 (我想我是在第一次设置的时候,这就是为什么chroot_local_user被设置的原因)
# You may specify an explicit list of local users to chroot() to their home # directory. If chroot_local_user is YES, then this list becomes a list of # users to NOT chroot(). chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list chroot_local_user=YES userlist_enable=YES
…和/etc/vsftpd.chroot_list是一个空文件。
确保用户的主目录设置正确(不是/ root):
usermod -d /home/user user