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.

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:

secutil.c:53  
/* 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
add comment

2 Answers 2

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
add comment

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