关闭selinux、关闭防火墙
setenforce 0 && sed ‘s/SELINUX=enforcing/SELINUX=disabled/g’
/etc/selinux/config systemctl stop firewalld && systemctl disabled
修改 /etc/vsftpd/vsftpd.conf 配置文件
- 方式一、
chroot_local_user=YES # 限制所有用户在主目录
allow_writeable_chroot=YES # 增加读写权限(这个时候写权限是被拿掉了)
systemctl restart vsftpd # 重启vsftpd服务
- 方式二、
chroot_list_enable=YES # 启用限制用户
chroot_list_file=/etc/vsftpd/chroot_list #将限制的用户写入到chroot_list文件中
allow_writeable_chroot=YES # 增加读写权限(这个时候写权限是被拿掉了)
修改 /etc/vsftpd/chroot_list 文件加入 ftp 用户
systemctl restart vsftpd # 重启vsftpd服务