1

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.

Castaglia
  • 3,349
  • 3
  • 21
  • 42
Roman Byshko
  • 254
  • 2
  • 13

2 Answers2

1

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.

mgorven
  • 30,615
  • 7
  • 79
  • 122
1

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.

Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81
  • 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 08:51