CentOS

VSFTP chroot jail users – Limit FTP users access to home directory

JJ
Jobin Joseph · Founder and CEO
·Published 1 February 2017·1 min read

Lets see how we can configure a secure FTP server on CentOS  RHEL 6 / 7

First, you need to install the vsftp package on your server

yum install -y vsftpd

Once installed, lets start editing the configuration file,
vim /etc/vsftpd/vsftpd.conf

Line #12 disable anonymous FTP access, with the below configuration change.
anonymous_enable=NO

Chroot / Jail FTP users to their home directory

by default, any FTP user can login and access the entire files on the systems including /etc which is extremely dangerous.

Line #100 , enable the below setting.
chroot_local_user=YES
also add the below new setting to the vsftpd.conf file
allow_writeable_chroot=YES

Now, Start the service and enable the service on boot.

systemctl restart vsftpd
systemctl enable vsftpd

Now the FTP users will be able to login and access their home directory only.

Jobin Joseph
Jobin Joseph, Founder and CEO
5x AWS Certified, ISO 27001:2022 Lead Implementer, 17+ years building cloud infrastructure for regulated industries.
About Jobin →

Reading this because your AWS bill or uptime is a problem?

30 minutes, direct with the founder, no sales pitch: one specific recommendation for your AWS workload.

Book a free 30-minute review
30 min Free Consultation →