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

Posted on 2009-04-24
Last Modified: 2013-12-02
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.
Question by:parlays
    LVL 13

    Expert Comment

    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.
    LVL 13

    Expert Comment

    Well can't be done without modifying their home directory location in /etc/passwd
    LVL 5

    Accepted Solution


    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why do Marketing keep bothering you?

    Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

    Hello, As I have seen there a lot of requests regarding monitoring and reporting for exchange 2007 / 2010 / 2013 I have decided to post some thoughts together and link to articles that have helped me. Of course a lot of information you can get…
    I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now