FTP user limitation to a specific folder

Posted February 24, 2016 6.8k views
UbuntuGetting Started

I need to lock/chroot/limit a FTP user to a specific folder
My droplet is Ubuntu
I installed vsftpd

I’ve created a new user using:
sudo usermod -d /home/USERNAME USERNAME

I’ve binded the html folder to the new user folder
mount –bind /var/www/html /home/USERNAME/www/html

I’ve edited the vsftpd.conf file and modified the following:

I saved the file
restarted the vsftpd using:
service vsftpd restart

when I connect from my pc using filezilla I’m still able to navigate through all the servers folder
any help?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

The first thing that jumps out to me is that the parameter in vsftpd.conf should be


instead of


This is an older tutorial (targeting Ubuntu 12.04) but the vsftpd configuration section should still cover what you’re looking to do. The configuration in that tutorial includes chrooted user accounts.

I should also point out that unless it’s absolutely necessary it’s not generally recommended to run an FTP service as it’s an insecure protocol. SFTP provides a much better, encrypted option for file transfers.

by Etel Sverdlov
Vsftpd is a fast and secure FTP server. Installing an FTP server can assist you with uploading files to your droplet. This tutorial describes how to install and set up vsftpd on Ubuntu 12.04.
  • sorry that was a typo
    I already added it just like you said (it was like this from the start)
    and I checked and followed almost every tutorials in the forums and I’ve googled it for 5 hours before posting my question