Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
#etc...

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...)?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted
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.

share|improve this answer
    
Thanks, this is what I've ended up doing. –  Paolo Feb 12 '10 at 13:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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