vsftpd install on Ubuntu

Install by apt

apt install vsftpd


vi /etc/vsftpd.conf

# listen=yes (Both ipv4 and ipv6)
listen=yes
#listen_ipv6=YES

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES

#log_ftp_protocol=YES
ascii_upload_enable=YES
ascii_download_enable=YES

# Chroot to all users. However, if you set chroot_local_user, 
# the users written in chroot_list will be excluded from chroot. Be careful!
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list

# Allow bulk deletion even if you have child directories.
ls_recurse_enable=YES

secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO

# Only users listed in user_list can log on.
userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd.user_list

# Allow chroot to writable directories.
# [500 OOPS: refusing to run with writable root inside chroot]
allow_writeable_chroot=YES

# passive mode(use port 11000-11100)
pasv_enable=YES
pasv_min_port=11000
pasv_max_port=11100

Register user who can login.

vi /etc/vsftpd.user_list
ast

Register the user you want to prohibit login.

/etc/ftpusers

Register user who do not need chroot. (file is required even if empty.)

touch /etc/vsftpd.chroot_list