1.安装vsftpd

sudo apt-get install vsftpd

2.配置vsftpd

sudo nano /etc/vsftpd.conf

# Run standalone? vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
listen=YES #将NO改为YES
#
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
listen_ipv6=NO #将YES改为NO
#

3.添加用户名和用户组

groupadd ftpuser
mkdir /home/tom/
useradd -g ftpuser tom
# 给用户设置密码
passwrd tom
# 输入两次密码

4.修改权限

sudo nano /etc/passwd

# 最后面是权限
tom:x:1001:1001::/home/tom:
# 增加/bin/bash
tom:x:1001:1001::/home/tom:/bin/bash
chown -v -R tom:ftpuser /home/tom/
chmod -v -R 700 /home/tom/

保存退出,执行:

 

5.重启vsftpd

sudo service vsftpd restart