Question

VSFTPD setup not complete

  • Posted February 20, 2013

Hello,

The VSFTPD article does not explain how to complete the setup for web servers.

Most of the users will be using it with Apache/nginx/etc. so it will be really useful if you could write an article explaining how to set that up, what are appropriate permissions etc.

Until then - I would really appreciate if someone could post the setup here, as I’m struggling with it now. The web is full of resources but none of them offer a universal solution and most of them are outdated.

Thanks!

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

VSFTPD, and any other FTP solution is going to upload / chroot to the users home directory, so if, when you created a user, you set their home directory to /home/username, then that’s the directory that will be used by vsftpd. <br> <br>You can use useradd -d to set the home directory for new users, i.e. <br> <br>useradd -d /path/to/upload/folder username <br> <br>So if your username was batric, for example, and you wanted the user to upload to /var/www or /var/www/batric, then you’d use one of the following: <br> <br>useradd -d /var/www batric <br> <br>- OR - <br> <br>useradd -d /var/www/batric batric <br> <br> <br> <br>You can use usermod to change the directory of an existing user. <br> <br>usermod -d /var/www batric <br> <br>usermod -d /path/to/any/directory batric <br> <br>usermod -d /home/batric <br> <br>…etc :-).

That’s not the point of my question. <br> <br>I want this to work with a webserver and to allow users to upload files to /var/www/ and not to /home/[user]/files

Well, enable LocalUsers in VSFtpd, chroot them into their homes and you’re most likely done - short version, sorry :-)