我已经用 vsftpd 安装了 ubuntu 12.04。我需要创建只能访问像 /var/www/nameDirectory 这样的目录的 FTP 用户。我认为这是一个非常基本的功能,但似乎不是我尝试使用的,在 vsftpd.conf 中
chroot_local_user=YES
Run Code Online (Sandbox Code Playgroud)
但是(使用 adduser 创建用户 'test')'test' 仍然能够浏览文件系统。我设法将“test”(使用 usermod)的根目录更改为 /var/www/nameDirectory 但他仍然能够返回到 /var 或 /。
然后我试过了
chroot_local_user=NO
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
Run Code Online (Sandbox Code Playgroud)
创建列表文件并将“测试”放入其中。也没有财运。
最后我什至试图遵循这个https://askubuntu.com/questions/575523/how-to-setup-virtual-users-for-vsftpd-with-access-to-a-specific-sub-directory 但没有不行。
我错过了一些东西。
问题是在 FileZilla 中,我可以使用用户“test”访问,该用户位于正确的目录中,但有权浏览所有内容。
这是我的 vsftpd.conf
listen=YES
anonymous_enable=YES
local_enable=YES
write_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=NO
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
secure_chroot_dir=/var/run/vsftpd/empty
rsa_cert_file=/etc/ssl/private/vsftpd.pem
Run Code Online (Sandbox Code Playgroud)
编辑:只是为了玩,我试图在 /etc/vsftpd.conf 中将 local_enable 设置为 NO 或 write_enable 为 NO 但没有效果(仍然可以通过 FTP 访问,仍然可以使用用户“test”写入)。也许这是错误的conf文件?或者其他一些软件正在为我提供 FTP 服务?我怎么知道发生了什么?
编辑 2:停止 vsftpd(服务 vsftpd 停止)并且仍然能够连接到 FTP。我怎么知道是什么给了我 FTP 访问权限?
| 归档时间: |
|
| 查看次数: |
600 次 |
| 最近记录: |