一、LINUX最小安装
Linux 版本
二、禁用防火墙
禁用firewall也可以,更彻底:
systemctl disable firewalld
@其他关于防火墙的命令
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld
开机禁用 : systemctl disable firewalld
开机启用 : systemctl enable firewalld
三、关闭selinux
关闭selinux,不关闭ftp工具应该可以连接,但是传输文件的时候,会发现文件上传和下载都会出现500、503 、200等报错
通过配置文件修改禁用
#打开SELINUX配置文件
vi /etc/selinux/config
#修改配置参数
#注释
SELINUX=enforcing
#增加
SELINUX=disabled
四、安装VSFTPD
#安装
yum install -y vsftpd
#设置开机启动
systemctl enable vsftpd.service
#启动
service vsftpd start
#停止
service vsftpd stop
#查看状态
service vsftpd status
五、虚拟用户配置
首先需要我们新建一个虚拟宿主用户,也就是上边说的要映射的真实用户:
useradd virtualhost -s /sbin/nologin
这里设置宿主用户也不允许登录系统
修改配置文件如下(红色字体为修改处):
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
# When SELinux is enforcing check for SE bool ftp