Linux 下搭建 ftp 服务
服务器环境:CentOS 7.9
工具:Xshell7
安装 vsftpd
yum -y install vsftp
启动 FTP 服务并设置 FTP 服务开机自启动****
systemctl start vsftpd.service
systemctl enable vsftpd
查看 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
客户端测试