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.


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.

| improve this answer | |
  • Please see my comment to the other answer and note that I've added to the question. – Roman Byshko 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.

| 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 Byshko Jul 31 '12 at 8:51

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.