Reference article: https://www.waitig.com/linux-or-centos-install-vsftpd-and-setup-it.html
The steps are summarized as follows:
Installation: Yum Install VSFTPD
Action: Service VSFTPD Start|stop|restart
Configuration section (emphasis):
1. In order to secure the system, an FTP user is generally established, the user cannot log on to the system, and can only access the files in their home directory.
useradd-d/var/ftp/test-g ftp-s/sbin/nologin ftpuser
Where the-d command is specified with the home directory,-G is the specified user group,-s/sbin/nologin is forbidden to login to the system, and finally Ftpuser is the user name of this new user.
then set the password: passwd Fptuser
2. Configure the user login list and add the new user to the FTP login list.
The user list is configured by opening the configuration file and finding the following two lines, removing the comment symbol.
chroot_list_enable= YES
# (default follows)
chroot_list_file=/etc/vsftpd/chroot_list
This defines a user list that only users on the list can log into the system.
3. Create this /etc/vsftpd/chroot_list file and add the user name Ftpuser you can access. Then restart the FTP service.
Operation Explanation:
-d/var/ftp/test----------------------------------remote machine to access the root directory of this FTP server, the file list is consistent with this directory.
USERADD/PASSWD---------------------------------a local user name and password
/etc/vsftpd/chroot_list---------------------------Local user name XX as the FTP user name
A simple tutorial on building an FTP server for Linux