Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

NOTE: Users are chrooted and their local_root is set to /srv/ftp.

Why vsftpd forces local chrooted users to have home directory? It will refuse to work if there is not any. And I've found the following in the code:

/* Always do the chdir() regardless of whether we are chroot()'ing */

What is the purpose of that? Why should one chdir shortly to home and then to local_root.

share|improve this question

I'm guessing because it's useful for the user to start off in their home directory when they connect, instead of being dropped into / (or somewhere else) and having to cd into their home directory most of the time.

The home directory should be taken from /etc/passwd though, so you can set it to anything you like (it doesn't have to be /home/<username>). You could make it /tmp or even / if you wanted to.

share|improve this answer
Please see my comment to the other answer and note that I've added to the question. – Roman B. Jul 31 '12 at 8:53

What good is a chroot for if it drops you to / by default? The purpose of chrooting users to their home directory is to prevent them wandering around elsewhere -- the lack of homedir would defeat that and be horribly error prone.

share|improve this answer
There is an option local_root which I'm using, so the users are chrooted there. The question is why to shortly change to home before this. – Roman B. Jul 31 '12 at 8:51

Your Answer


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.