[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1268
  • Last Modified:

Using VSFTP to CHROOT a user to other than their home directory?

Hello everybody!

I have set up VSFTP on my server to CHROOT users to their home directory.  But how can I set it up so that they can CHROOT into another directory such as '/var/www' so they can edit a website.  I know I can change their home directory to '/var/www' but is there a way for VSFTP to chroot them on the fly?  I can't find a setting for that.  Thanks.
  • 2
1 Solution
VSFTP locks users to their home directories only.  There are no configuration options to specify that user1 should be locked to /var/www, but user2 should be locked to /home/user2

vsftpd reads the passwd file in /etc/ to obtain this information.  Sorry it can not be done at this stage.
Well can't be done without modifying their home directory location in /etc/passwd

you could try using the "user_config_dir" option and setup a separate configuration file just for this user
 check out
Man vsftpd.conf 5

or you could try {Note: not sure how this works if /var/www is already mounted for partitioning}
mount --bind /var/www /home/user/www
this will allow /var/www to be access via the www folder in their home folder

umount /var/www
to unmount


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now