To set up an FTP server on CentOS 7, it is recommended to use vsftpd. Below are the detailed steps:
Step 1: Install vsftpd
sudo yum install vsftpd -y

Step 2: Start the service and set it to start on boot
sudo systemctl start vsftpd
sudo systemctl enable vsftpd
Step 3: Configure the firewall
# Open FTP service
sudo firewall-cmd --permanent --add-service=ftp
sudo firewall-cmd --reload

Step 4: Configure vsftpd
Edit the configuration file:
sudo vi /etc/vsftpd/vsftpd.conf
Key configuration changes (adjust as needed):
# Disable anonymous login (security recommendation)
anonymous_enable=NO
# Allow local users to log in
local_enable=YES
# Allow write operations
write_enable=YES
Step 5: Create an FTP user
Option 1: Use a system user
sudo useradd -m ftpuser # Create user
sudo passwd ftpuser # Set password
Step 6: Set directory permissions
# Create a directory for the user (example)
sudo mkdir -p /home/ftpuser/files
sudo chown ftpuser:ftpuser /home/ftpuser/files
sudo chmod 750 /home/ftpuser/files # Restrict access to other users
Step 7: Restart the service to apply changes
sudo systemctl restart vsftpd
Step 8: Test the connection.
Test directly with an FTP client or enter ftp://ip_address in the Windows file explorer.
Create a folder
You can access the FTP server and create folders. Through the above steps, you have successfully deployed a secure FTP server on CentOS 7.