系统运维|ftp配置用户访问固定目录

SFTP用户目录指定
VSFTP用户目录指定
1修改VSFTP配置文件
Vi /etc/vsftpd/vsftp.conf
#启动chroot列表
chroot_list_enable=YES
#指定列表位置
chroot_list_file=/etc/vsftpd/chroot_list #这个配置的制定哪些用户不能使用chroot ,默认为空即可
userlist_enable=yes
#禁止文件/etc/vsftpd/user_list文件中的用户登陆FTP
############################主要配置###############################
#添加读取用户配置目录(注:本行配置默认没有需要手动输入)
user_config_dir=/etc/vsftpd/userconf
2.建立用户配置目录
mkdir /etc/vsftpd/userconf
3.建立用户登陆后的目录
mkdir /test01
mkdir /test02
4.添加用户配置文件,FTP用户登陆后指定的目录
已知有用户tourres01 tourres02
注:有很多用户时,需要建每个用户相对应的文件
Vi /etc/vsftpd/userconf/tourres01
local_root=/test01
Vi /etc/vsftpd/userconf/tourres02
local_root=/test02
#########################################################
5重启VSFTP
./vsftdp vsftpd.conf &
登陆tourres01用户.FTP将登陆至/test01目录
【系统运维|ftp配置用户访问固定目录】登陆tourres02用户.FTP将登陆至/test02目录

    推荐阅读