应用系统环境说明:
Ubuntu16.04
uname -a
Linux <ServerName> 4.15.0-45-generic #48~16.04.1-Ubuntu SMP <Date_Info> UTC <Year_Info> x86_64 x86_64 x86_64 GNU/Linux
阿里云软件源
sudo vim /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
开始部署:
一、安装vsftp
sudo apt-get update && sudo apt-get -y install vsftpd
二、编辑配置文件
sudo vim /etc/vsftpd.conf
...
listen=YES #启用IPv4地址端口监听
...
listen_ipv6=NO #禁用IPv6地址端口监听
...
anonymous_enable=YES #启用匿名访问
...
local_enable=YES #启用本地用户登陆
...
write_enable=YES #启用任何形式的 FTP 写入命令
...
ssl_enable=NO #启用任何形式的 FTP 写入命令
...
三、重启vsftpd服务
sudo systemctl restart vsftpd
四、切换目录到ftp根目录
cd /srv/ftp
验证服务状态:
netstat -vatunp | grep 21
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN -
systemctl status vsftpd.service
● vsftpd.service - vsftpd FTP server
Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: e
Active: active (running) since <Date_Info> CST; <Duration_Time> a
Process: 215811 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (code=exited,
Main PID: 215813 (vsftpd)
Tasks: 1
Memory: 332.2M
CPU: 2min 59.989s
CGroup: /system.slice/vsftpd.service
└─215813 /usr/sbin/vsftpd /etc/vsftpd.conf