天天看点

VSFTPD 配置VSFTPD 配置

VSFTPD 配置

Ubuntu中vsftpd的配置文件为/etc/vsftpd.conf

1. 限制用户登陆到home路径下的指定文件夹

为了指定用户登录ftp后的路径,默认的路径是用户的home路径,想要修改下,修改到其home路径下的ftp路径中即:/home/username/ftp,在vsftpd.conf中添加下列语句:

user_sub_token=$USER

local_root=/home/$USER/ftp

修改完成后,重启服务即可

2. 限制用户登录ftp后,只能访问当前路径,无法访问上层路径

chroot_local_user=NO

allow_writeable_chroot=YES

chroot_list_enable=YES

chroot_list_file=/etc/vsftpd/vsftpd.chroot_list

chroot_local_user 为NO,chroot_list_enable 为YES表示只有vsftpd.chroot_list中的用户受限

chroot_local_user 为YES,chroot_list_enable 为NO  表示所有用户都受限

chroot_local_user 为YES,chroot_list_enable 为YES表示只有vsftpd.chroot_list中的用户都不受限

chroot_local_user 为NO,chroot_list_enable 为NO表示所有用户都不受限

继续阅读