Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

In my config file, I have


but $USER doesn't seem to give me the user's login name. It's taking it as literally $USER when I attempt to login and fails to change to that directory.

share|improve this question
What distro are you using? Any logs in /var/log/daemon or /var/log/messages or /var/log/vsftpd.log pertaining to vsftpd ? – Zypher Jan 9 '10 at 6:09
I'm using Jaunty Ubuntu. I'll get back to you on the logs issue - I won't be able to touch the ftp service till after a user uploads their files. – Tereno Jan 9 '10 at 6:28

It sounds like you are trying to chroot users into their home directories; try this in /etc/vsftpd/vsftpd.conf instead:

# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (default follows)

I found it a bit unintuitive that the sample config for CentOS (quoted above) refers to chroot_local_user, but doesn't actually provide it in the config file.

Update: to explain a bit more:

If chroot_local_user=yes then users get chroot'd to their home directories UNLESS they are listed in chroot_list_file (in which case they have normal access to the entire file system).

If chroot_local_user=no then users do NOT get chroot'd to their home directories UNLESS they are listed in chroot_list_file (in which case, they do get chroot'd).

So to chroot by default (which sounded like what you were trying to accomplish), set chroot_local_user=yes. List any exceptions (users you do not want chroot'd) in chroot_list_file.

Note that you do not have to list users without FTP access in this file in either case.

share|improve this answer
So the list is a list of users not to chroot? I would like to create a directory structure that is not based on the normal HOME directory of Linux. Instead, I'm looking for something like /var/www/sites/$USER ?? If I can specify them in a list, would it just be key-value pairs? Thanks! – Tereno Jan 9 '10 at 6:30
are they ftp only users or do they need shell access? If the former ... just set their home directory to /var/www/sites/$USER (not the variable but the actual user name – Zypher Jan 9 '10 at 6:55

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.