我已经按照这个教程安装了vsftpd: https : //help.ubuntu.com/6.06/ubuntu/serverguide/C/ftp-server.html
安装顺利,我可以按照预期使用我的本地用户凭据进行连接。 不过,我有目录列表和权限的问题..
如果我不使用chroot_local_user限制本地用户到他们的主目录,他们能够浏览整个文件系统到最深的/ dev文件夹。
另一方面,当我尝试启用chroot_local_user指令时,用户确实被限制到他们的主目录,但是最初的远程目录是根分区。 列出任何目录会引发用户主目录以外的授权错误。
我检查了vsftpd的configuration,似乎没有做我想要的东西..
另一件我不明白的事情是,为什么地球上的软件包安装正在创build一个/ home / ftp目录,如果它不使用它的话。
编辑:我已经注意到,vsftpd是以root身份运行。是预期的行为?
确保local_root没有设置:
local_root This option represents a directory which vsftpd will try to change into after a local (ie non-anonymous) login. Failure is silently ignored. Default: (none)
另外,这个选项可能是服务:
passwd_chroot_enable If enabled, along with chroot_local_user , then a chroot() jail location may be specified on a per-user basis. Each user's jail is derived from their home directory string in /etc/passwd. The occurrence of /./ in the home directory string denotes that the jail is at that particular location in the path. Default: NO
然后你可以把/home/user/./添加到/ etc / passwd文件中。
最后,ftp用户是为匿名login创build的:
ftp_username This is the name of the user we use for handling anonymous FTP. The home directory of this user is the root of the anonymous FTP area. Default: ftp