VSFTP Chroot or Jail Users – Limit Users to Only Their Home Directory
Now normal user can go to /etc directory (may be to all other directories) and if there is read only permission to sensitive files user can download the file via ftp. To avoid this security problem you can lock ftp user in a jail. Open vsftpd configuration file “/etc/vsftpd/vsftpd.conf”
$ vi /etc/vsftpd/vsftpd.confMake sure following line exists (and uncommented):
chroot_local_user=YESSave and close the file. Restart vsftpd.
$ sudo /etc/init.d/vsftpd restartOR
$ sudo service vsftpd restartNow all users of VSFTPD/FTP will be limited to accessing only files in their own home directory. They will not able to see /, /etc, /root and /tmp and all other directories. This is an essential security feature.