yum install vsftpd -y
systemctl restart vsftpd
(登录阿里云的防火墙设置,开启21端口)
安装目录: /etc/vsftpd/
修改配资文件: vim /etc/vsftpd/vsftpd.conf
set nu 显示行号,然后在96,97行修改,让系统用户能访问,
chroot_local_user=YES ## 锁定用户自己的目录(亲测OK)
chroot_list_enable=NO ## YES会冲突,启用目录文件: chroot_list_file=/etc/vsftpd/chroot_list
anonymous_enable=NO #关闭匿名访问(亲测OK)
local_enable=YES #开启系统用户登录(亲测OK)
#500 OOPS: vsftpd: refusing to run with writable root inside chroot() 错误的解决办法
allow_writeable_chroot=YES ## 添加
#来查看你的ID,并锁定目录为:/myweb/new
cat /etc/passwd | grep graphis
[root@ysdag ~]$ cat /etc/passwd | grep graphis
adiao:x:500:498::/home/adiao:/bin/bash
zlb:x:501:0::/home/zlb:/bin/bash
graphis:x:502:502::/myweb/new:/sbin/nologin #当前用户目录,加上nologin
xsd:x:503:503::/myweb/graphis:/bin/bash
abiao:x:504:504::/home/abiao:/bin/bash
shop:x:506:506::/myweb/shop:/sbin/nologin