参考博客:
修改指定目录:https://www.cnblogs.com/huangye-dream/p/3454595.html

一、安装环境

[root@localhost ~]# cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)

二、安装 FTP

安装:yum默认安装目录/etc/vsftpd

yum -y install vsftpd

查看:

rpm -qa |grep vsftpd

在这里插入图片描述
卸载:

rpm -e vsftpd-3.0.2-25.el7.x86_64

三、修改配置

3.1 添加ftp用户

添加一个禁止ssh登录的用户

useradd ftpuser  -s /sbin/nologin
passwd ftpuser

四、启动验证

启动:systemctl start vsftpd.service
重启:systemctl restart vsftpd.service
停止:systemctl stop vsftpd.service
开机自启:systemctl enable vsftpd.service

4.1 浏览器输入:ftp://192.168.48.128/ ,目录默认路径:/var/ftp/pub

在这里插入图片描述
创建一个test目录

mkdir /var/ftp/pub/test

浏览器刷新查看
在这里插入图片描述

Logo

更多推荐