Setup FTP Server on CentOS: Step-by-Step Guide

To set up an FTP server on CentOS, you can follow these steps:

  1. Install the vsftpd software package:
sudo yum install vsftpd
  1. Start the vsftpd service and enable automatic startup.
sudo systemctl start vsftpd
sudo systemctl enable vsftpd
  1. The vsftpd configuration file is located in /etc/vsftpd/vsftpd.conf.
  2. What is the matter?
sudo vi /etc/vsftpd/vsftpd.conf

Make the following configuration changes in the file.

  1. Change anonymous_enable=YES to anonymous_enable=NO to disable anonymous access.
  2. Make changes to the following line to allow local users to log in:
local_enable=YES
write_enable=YES
  1. If you need to restrict the access range for users, you can set chroot_local_user=YES, which will confine users to only operate within their home directory.
  1. Establish firewall rules to allow FTP access:
    If there are firewall rules in place, it is necessary to configure rules that allow FTP access.
sudo firewall-cmd --zone=public --add-port=21/tcp --permanent
sudo firewall-cmd --reload
  1. Restart the vsftpd service to apply the configuration changes.
sudo systemctl restart vsftpd

You have successfully set up an FTP server on your CentOS system, allowing users to connect to your server using an FTP client and transfer files.

bannerAds