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