Linux下搭建ftp服务

151 阅读1分钟

Linux 下搭建 ftp 服务

服务器环境:CentOS 7.9

工具:Xshell7

安装 vsftpd

yum -y install vsftp   image.png

启动 FTP 服务并设置 FTP 服务开机自启动****

systemctl start vsftpd.service

systemctl enable vsftpd

image.png

查看 FTP 服务监听的端口****

netstat -antup | grep ftp   image.png

配置 ftp

FTP 服务器创建一个用户和密码****

adduser anyu

passwd anyu

image.png

创建 FTP 服务器使用的文件目录

mkdir /var/ftp/test

image.png   /var/ftp/test 目录的拥有者设置为 anyu

chown -R anyu:anyu /var/ftp/test

image.png   修改 vsftp.conf 配置文件

vi /etc/vsftpd/vsftpd.conf

Anonymous_enable=NO禁止匿名访问

image.png 添加防火墙例外

firewall-cmd --zone=public --add-port="21"/tcp --permanent

firewall-cmd --permanent --query-port="21"/tcp

firewall-cmd --reload   image.png

客户端测试

image.png