Create FTP users with access to only specified folders

Posted October 7, 2013 13.9k views
Hello, I have my server where I host my page, but also want to host some pages for my friends, but I dont want them to have complete access to all folders on the server. What is the best way to create a ftp user, so that I can set a login/password and define the folders where they have access, for example, i want that /var/www/ will be their / root folder when they connect though ftp. I was checking some ftp program, and the problem is that I had to create new linux user for each ftp account, Im looking for a simpler solution. Thank you!

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
5 answers
It would be best to create a separate user for each of your friends that you want to give hosting space to, this allows you to provide granular permissions, keep their sites separate and even monitor their disk usage (with quota).

Since OpenSSL has SFTP embedded you don't even need a separate FTP server, and Apache's userdir mod can satisfy the rest of your requirements.

If you'd like help with any of this please feel free to stop by the IRC channel at and have a chat with us!
Any pointers on where to go from here? :)
IMHO, giving your friends FTP access w/passwords creates too much of a security risk. I'd set up key-based authentication for them; so that they can connect via SFTP with FileZilla.
by Pablo Carranza
This tutorial runs through creating SSH keys with PuTTY to connect to your virtual server.