UBUNTU:用户login时,ftp-server无法更改目录

我为一个客户端用户(ftuser)build立了一个FTP服务器(vsftpd)。 此用户应该有权访问文件夹/ srv / webroot / user。 文件夹/ srv和所有子文件夹归我所有。 我不是像ftpuser那样在同一个组里。 现在我试图通过以下方式来实现用户的权限

chmod 770 -R /srv chmod 777 -R /srv/webroot/user 

但是当用户尝试通过FTPloginFTP服务器时,

 500 OOPS: cannot change directory: /srv/webroot/user 

就像我尝试给整个文件夹strcuture的用户权利

 chmod 777 -R /srv 

现在他不仅可以login,还可以访问根文件夹(/)和所有其他子文件夹(即/ etc,/ home,…)。

如何设置权限,以便我的用户能够login并只能访问/ srv / webroot / user?

如果你想让用户只看到它自己的文件,那么你必须在vsftpd.conf中设置“与chroot”相关的选项。 限制ftp用户访问“chmod”和“chown”是一个不好的方法。 用户必须能够在其ftp-root目录中写入login。

为了允许用户改变到一个特定的目录cd ,用户应该有x权限(数字位1)。 如果你不想让这个权限给每个人,你需要允许它用于组g+x或用户u+x 。 当然,你也需要设置正确的所有权。

heinob – /etc/vsftpd.conf中有一个部分如下

 # 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().(Warning! chroot'ing can be very dangerous. If using chroot, make sure that the user does not have write access to the top level directory within the chroot) #chroot_local_user=YES #chroot_list_enable=YES # (default follows) #chroot_list_file=/etc/vsftpd.chroot_list 

你确定chroot_local_user=YES是不是不注释?