ติดตั้ง vsftpd บน CentOS 7

Step 1: Install FTP Service with VSFTPD

1.Start by updating the package manager:

$ sudo yum update

2.Install VSFTPD software 

$ sudo yum install vsftpd

3. Start the service and set it to launch when the system boots with the following:

$ sudo systemctl start vsftpd
$ sudo systemctl enable vsftpd

4. Next, create a rule for your firewall to allow FTP traffic on Port 21

$ sudo firewall-cmd --zone=public --permanent --add-port=21/tcp
$ sudo firewall-cmd --zone=public --permanent --add-service=ftp
$ sudo firewall-cmd –-reload

Step 2: Configuring VSFTPD

1. Before starting, create a copy of the default configuration file:

sudo cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.default

2. Next, edit the configuration file 

sudo nano /etc/vsftpd/vsftpd.conf

3. Set your FTP server to disable anonymous users and allow local users

anonymous_enable=NO
local_enable=YES

4. Next, allow a logged-in user to upload files to your FTP server.

write_enable=YES

5. Limit FTP users to their own home directory. This is often called jail or chroot jail. Find and adjust the entry to match the following:

chroot_local_user=YES
allow_writeable_chroot=YES