一、安装前准备
1、关闭默认firewall
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
2、开启iptables
yum -y install iptables-services #安装
iptables systemctl enable iptables #设置开机自启
systemctl enable iptables.service #两个都执行
二、安装vsftpd
1、安装vsftpd并设置开机自启
在线安装
yum -y install vsftpd #安装
离线安装
1)安装包下载 ftp百度网盘下载
2)如果网盘失效可以找一台有网络的linux服务器
#下载vsftpd的rpm包,/home/mjb/soft/vsftpd是rpm下载路径
sudo yum install --downloadonly --downloaddir=/home/mjb/soft/vsftpd vsftpd
3)安装vsftpd的rpm包
#通过sftp工具下载并上传至离线服务器,使用下部命令安装vsftp
#其中i表示安装,v表示显示安装过程,h表示显示进度
rpm -ivh ***.rpm
启动
vsftpd systemctl start vsftpd.service #启动
设置vsftpd开机自启动
vsftpd systemctl enable vsftpd.service #设置vsftpd开机自启动
2、编辑/etc/vsftpd/vsftpd.conf文件(可直接替换)
# 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=YES
#
# Uncomment this to allow local users to log in.
# When SELinux is enforcing check for SE bool ftp_home_dir
local_enable=YES
#
userlist_deny=NO
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=077
#
# Uncomment this to allow the anonymous FTP user to upload files. This