CentOS 7 Configuration FTP (VSFTPD)
1-First switch to root user
$ su
# Enter root password
2-Create FTP folder, current location is/ftp, can be customized
# CD/
# mkdir FTP
3-Installing VSFTPD with Yum
# yum-y Install FTP vsftpd
4-View the path to the configuration file
# RPM-QC VSFTPD
5-Backing up the original configuration file
# cd/etc/vsftpd/
# CP vsftpd.conf Vsftpd.conf.backup
6-Create password plaintext file (Vftpuser for subsequent created guest account name, customizable)
# Vi/etc/vsftpd/vftpuser.txt
The contents of the file are as follows: Odd behavior user name even behavior password
TestUser
123
7-Create a password DB file based on the password plaintext
# db_load-t-T hash-f/etc/vsftpd/vftpuser.txt/etc/vsftpd/vftpuser.db
8-View Password data file
# file/etc/vsftpd/vftpuser.db
9-Create a VSFTPD Guest account, create a password
# useradd-d/ftp-s/sbin/nologin Vftpuser
# passwd Vftpuser
Enter password
10-Modify the/etc/pam.d/vsftpd file to comment out all configuration of auth and account, add the following content
# VI/ETC/PAM.D/VSFTPD
Auth Required pam_userdb.so Db=/etc/vsftpd/vftpuser
Account Required Pam_userdb.so Db=/etc/vsftpd/vftpuser
11-Modify the/etc/vsftpd/vsftpd.conf file to change the #anonymous_enable=yes to Anonymous_enable=no
(Note that there is no # after change) to add the following at the bottom
# vi/etc/vsftpd/vsftpd.conf
Virtual_use_local_privs=yes
Guest_enable=yes
Guest_username=vftpuser (Note that the account here is the Guest account name created above)
Chroot_local_user=yes
Allow_writeable_chroot=yes
12-Set VSFTPD boot
# Systemctl Enable VSFTPD
13-Restart VSFTPD service
# systemctl Restart VSFTPD
14-Configuring Firewalls and SELinux
# firewall-cmd--permanent--zone=public--add-service=ftp
# Firewall-cmd--reload
# Getsebool-a | grep FTP
# setsebool-p Ftpd_full_access on
15-View VSFTPD service status
# SYSTEMCTL Status Vsftpd.service
16-Change the FTP user to the Guest account created above
# chown vftpuser/ftp/
CentOS 7 Configuration FTP (VSFTPD)