Create FTP user for /var/www

April 10, 2014 11.4k views
Hello, i have a WordPress droplet, with 2 users. One is root, and another one i created. This second one is sudoer too, but if i log in with FileZilla, i can't go back in folders tree and navigate to /var/www How can i enable this user to properly navigate only in /var/www and manage files? Thanks!
3 Answers
You'll want to jail the user with a chroot. Here's a good tutorial I found while Googling that should get exactly what you want done. Just change the directory and user to the appropriate ones you need.

http://www.thegeekstuff.com/2012/03/chroot-sftp-setup/
You can use PROftpd with mysql back end:

https://www.digitalocean.com/community/articles/how-to-set-up-proftpd-with-a-mysql-backend-on-ubuntu-12-10
by Matjaž Črnko
This article will guide you thorough setting up ProFTPD on Ubuntu with a MySQL backend for users and groups.
@Bryan Thanks, but that tutorial says to create a new user and chroot the folder for it, but i want the folder owner to be www-data as it is now.

@Daniyaal is it only for FTP, right? I'd like to use SFTP instead.
Have another answer? Share your knowledge.