FTP
- 需求:liul用户限制访问指定目录/zss/liul,只能下载不能上传
useradd -s /sbin/nologin liul
usermod -d /zss/liul liul
vim /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd/user_list
write_enable=YES
chroot_local_user=NO
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
allow_writeable_chroot=YES
echo liul >> /etc/vsftpd/chroot_list
service vsftpd restart
setfacl -m u:liul:rwx liul
setfacl -m u:liul:r-x liul
500 OOPS: could not read chroot() list file:/etc/vsftpd/chroot_list
报错 我文件搞错了
echo liul >> /etc/vsftpd/chroot_list
226 Transfer done (but failed to open directory).
关闭selinux即可
vim /etc/selinux/config
SELINUX=disabled
修改完重启或者暂时修改setenforce 0