I want to set up two FTP users for my server (Ubuntu 8.04):

  1. One that logs into /var/www so they can access and administer all the web site files
  2. One that is chroot'd to (say) /var/www/images so that they can only access the site's images

Ideally I'd like to be able to configure each user's FTP directory separately, something like:

#userid     chroot location
webadmin   /var/www
imageadmin /var/www/images

Is there a way of doing this with VSFTP? All the examples I can find with virtual users show chrooting with a /some/dir/$username format.

I presume I could create a local imageadmin account with a home directory of /var/www/images and use local logins instead? Is that sensible for an FTP-only user (I guess I could set the shell to null...)?

sudo useradd -d /var/www webadmin
sudo passwd webadmin
sudo useradd -d /var/www/images imageadmin
sudo passwd imageadmin

Vsftpd will automatically chroot users to their home dirs, so if you create the users with home dirs pointing to the ones you want them to be jailed in, you're all set.

Setting the shell to null is a good idea. It is also possible to deny logins to ssh for certain users.

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.