I wish to configure vsftpd in 11.10 so that when a user connects he is shown or redirected to a specific folder. The name of the folder is not related to the user or home folder. It is related to a folder in /var/www. For example:

If user cyrex logs in ftp he is redirected to /var/www/gamers or at least shown a gamers folder inside his home folder that redirects to /var/gamers. If user camelot logs in ftp he is redirected to /var/www/food or at least shown a food folder inside his home folder that redirects to /var/food. ...

The thing he should not leave his home folder and can only access folders inside his home folder that are redirected to other parts like the /var/www/FOLDERS.

UPDATE: In one way of configuration the user should see his home folder and also a folder that redirects him to /var/www/UserFolder. In another way of configuring VSFTPD the user should just be redirected to /var/www/UserFolder without even seeing his home folder, just the var/www specific to him. Can both methods be shown in one answer so I can test both to see which one is better.

What is the easier way to do this.

  • I would recommend proftpd though. I use it and it seems a lot simpler. – Severo Raz Oct 29 '11 at 17:50
  • If you can add the way of doing what am asking here with proftpd and it looks easier than vsftpd then I will change the question to it. the point is to do this with an ftp server. – Luis Alvarado Oct 29 '11 at 18:01

You just have to modify the startup call for vsftpd. The user_config_dir argument will tell the server to look for a configuration in the directory /etc/vsftpd_user_conf/luis if the user luis logs in. Analogously with any other user that logs in. I guess that if no configuration file is found the server will fallback to the default one.

Anyway, take a quick read at this manual page (which you can access too from the terminal with man vsftpd) : http://vsftpd.beasts.org/vsftpd_conf.html

This other guide can help you with using custom directories for your server: http://gofedora.com/how-to-configure-secure-ftp-server-vsftpd/

  • 1
    Ok lets say that I want the user to have access to his home folder but also to another folder in /var/www. How would the config file look like. I have updated the question to reflect this. – Luis Alvarado Oct 29 '11 at 17:54
  • 1
    Hm, so if I understand correctly, you want address/to/server to display his home folder and his "ftp folder" located at /var/www/user? Take a look at the second answer in this post: serverfault.com/questions/222906/… . So you will be able to select a custom directory on a per-user basis, and you could also create a mount (as shown in the second link I have you) that would serve as a link from the ftp folder to the user's home directory. – Severo Raz Oct 29 '11 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.