Linux下搭建ftp服务
服务器环境:CentOS 7.9
工具:Xshell7
安装vsftpd
yum -y installvsftp

启动FTP服务并设置FTP服务开机自启动
systemctl startvsftpd.service
systemctl enablevsftpd

查看FTP服务监听的端口
netstat -antup |grep ftp

配置ftp
为FTP服务器创建一个用户和密码
adduser anyu
passwd anyu

创建FTP服务器使用的文件目录
mkdir/var/ftp/test

将/var/ftp/test目录的拥有者设置为anyu
chown -R anyu:anyu/var/ftp/test

修改vsftp.conf配置文件
vi/etc/vsftpd/vsftpd.conf
Anonymous_enable=NO禁止匿名访问

添加防火墙例外
firewall-cmd--zone=public --add-port="21"/tcp --permanent
firewall-cmd--permanent --query-port="21"/tcp
firewall-cmd--reload

客户端测试
