0

In my config file, I have

local_root=/home/$USER

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.

2
  • 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, 2010 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, 2010 at 6:28

1 Answer 1

1

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

chroot_local_user=yes
# 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().
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd/chroot_list

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.

2
  • 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, 2010 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, 2010 at 6:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .