实验环境:
服务端
[root@westos_ftp Desktop]# hostnamectl set-hostname westos_ftp.westos.org
[root@westos_ftp Desktop]# nmcli connection show
[root@westos_ftp Desktop]# nmcli connection delete 删掉多余的
[root@westos_ftp Desktop]# nmcli connection add con-name ens160 ifname ens160 type ethernet ipv4.method manual ipv4.addresses 172.25.254.60/24
[root@westos_ftp Desktop]# mkdir /westos
[root@westos_ftp Desktop]# cd /etc/yum.repos.d/
[root@westos_ftp yum.repos.d]# ls
redhat.repo westos.repo
[root@westos_ftp yum.repos.d]# vim westos.repo
[root@westos_ftp Desktop]# mount /iso/rhel-8.2-x86_64-dvd.iso /westos
[root@westos_ftp yum.repos.d]# vim /etc/sysconfig/selinux
[root@westos_ftp yum.repos.d]# systemctl set-default multi-user.target
[root@westos_ftp yum.repos.d]# reboot
客户端:
[root@westos_client Desktop]# hostnamectl set-hostname westos_client.westos.org
[root@westos_client Desktop]# mkdir /westos
[root@westos_client Desktop]# mount /iso/rhel-8.2-x86_64-dvd.iso /westos
[root@westos_client Desktop]# cd /etc/yum.repos.d/
[root@westos_client yum.repos.d]# ls
redhat.repo
[root@westos_clientyum.repos.d]# vim westos.repo
[root@westos_client Desktop]# nmcli connection show
[root@westos_client Desktop]# nmcli connection delete 删掉多余的
[root@westos_client Desktop]# nmcli connection add con-name ens160 ifname ens160 type ethernet ipv4.method manual ipv4.addresses 172.25.254.70/24
[root@westos_client Desktop]# reboot
[root@westos_ftp Desktop]# dnf install vsftpd -y 下载vsftpd
[root@westos_ftp Desktop]# systemctl enable --now vsftpd 启用ftp服务
[root@westos_ftp ~]# firewall-cmd --permanent --add-service=ftp让火墙允许ftp服务通过
[root@westos_ftp ~]# firewall-cmd --reload 刷新火墙
[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf 修改主配置文件可以匿名登陆
[root@westos_ftp Desktop]# systemctl restart vsftpd.service重启服务
[root@westos_client Desktop]# dnf install lftp -y 下载lftp
[root@westos_client Desktop]# lftp 172.25.254.60 -u westos 本地登陆
[root@westos_client Desktop]# lftp 172.25.254.60 匿名登陆
家目录控制:
[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf修改主配置文件
[root@westos_ftp Desktop]# systemctl restart vsftpd 重启服务

还原方法是注释在主配置文件中加的
命令。
上传控制:

[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf编辑主配置文件

[root@westos_ftp Desktop]# systemctl restart vsftpd 重启服务
如果默认方有可写群限即无法登录并且报500安全错误
[root@westos_ftp Desktop]# chmod 755 /var/ftp修改该权限
[root@westos_ftp Desktop]# chgrp ftp //var/ftp/pub 改变pub的所有组为ftp
[root@westos_ftp ~]# chmod 775 /var/ftp/pub
目录建立控制:

[root@westos_ftp ~]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp ~]# systemctl restart vsftpd
下载控制:
[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp Desktop]# systemctl restart vsftpd
删除命令控制:
[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp Desktop]# systemctl restart vsftpd
匿名用户上传文件权限设定:
[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp Desktop]# systemctl restart vsftpd
匿名用户上传文件的用户身份设定:
[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp Desktop]# systemctl restart vsftpd
[root@westos_ftp ~]# grep bash /etc/passwd 查看有多少用户
登陆数量控制:
[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp Desktop]# systemctl restart vsftpd
上传速率控制:
[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp Desktop]# systemctl restart vsftpd
[root@westos_client ~]# dd if=/dev/zero of=file5 bs=1M count=1000
[root@westos_client ~]# lftp 172.25.254.60

登陆控制:
[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp Desktop]# systemctl restart vsftpd
家目录控制:
[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp Desktop]# systemctl restart vsftpd

写权限控制 
[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp Desktop]# systemctl restart vsftpd
上传文件权限控制
用户登陆控制
[root@westos_ftp Desktop]# vim /etc/vsftpd/ftpusers

用户登陆白名单
[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp Desktop]# systemctl restart vsftpd

[root@westos_ftp Desktop]# vim /etc/vsftpd/user_list 
锁定用户到自己的家目录中
[root@westos_ftp Desktop]# chmod u-w /home/*不允许用户切换到除了家目录的其他地方
锁定用户到自己的家目录中的黑名单
[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp Desktop]# vim /etc/vsftpd/chroot_list
[root@westos_ftp Desktop]# cat /etc/vsftpd/chroot_list
westos
[root@westos_ftp Desktop]# systemctl restart vsftpd
westos不可以浏览/ lee可以浏览/
锁定用户到自己的家目录中的白名单
[root@westos_ftp Desktop]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp Desktop]# systemctl restart vsftpd

[root@westos_ftp Desktop]# vim /etc/vsftpd/chroot_list
只有在名单里的westos可以浏览/ lee不可浏览/
[root@westos_ftp Desktop]# cd /etc/vsftpd/
[root@westos_ftp vsftpd]# pwd
[root@westos_ftp vsftpd]# vim ftpauth
[root@westos_ftp vsftpd]# db_load -T -t hash -f ftpauth ftpauth.db加密
[root@westos_ftp vsftpd]# vim /etc/pam.d/westos
[root@westos_ftp vsftpd]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp vsftpd]# systemctl restart vsftpd 
虚拟用户家目录的独立设定
[root@westos_ftp vsftpd]# mkdir -p /ftphome/user{1..3}/pub -p
[root@westos_ftp vsftpd]# touch /ftphome/user1/user1file
[root@westos_ftp vsftpd]# touch /ftphome/user2/user2file
[root@westos_ftp vsftpd]# touch /ftphome/user3/user3file
[root@westos_ftp vsftpd]# vim /etc/vsftpd/vsftpd.conf

[root@westos_ftp vsftpd]# systemctl restart vsftpd
用户配置独立
[root@westos_ftp vsftpd]# chmod 775 /ftphome/user{1..3}/pub
[root@westos_ftp vsftpd]# chgrp ftp /ftphome/user{1..3}/pub
[root@westos_ftp vsftpd]# vim /etc/vsftpd/vsftpd.conf
[root@westos_ftp vsftpd]# mkdir /etc/vsftpd/confdir
[root@westos_ftp vsftpd]# systemctl restart vsftpd

只有在文件中的user1可以上传