Setup ftp server on linux with VSFTPD

From DevOps Notebook
Revision as of 09:58, 25 August 2021 by MilosZ (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Depending on distro, install it first.
CentOS:

# yum install vsftpd # OR
# dnf install vsftpd

Debian:

# apt install vsftpd

Edit /etc/vsftpd/vsftpd.conf

anonymous_enable=NO
chroot_local_user=YES
pasv_enable=YES
pasv_min_port=1024
pasv_max_port=1048
pasv_address=<public_ip>
local_root=/var/www/html

Restart and enable

# systemctl restart vsftpd
# systemctl enable vsftpd

Create FTP user

# adduser <USERNAME>
# passwd <USERNAME>
# usermod -d /var/www/html <USERNAME>
# usermod -a -G www <USERNAME>