I have been trying for ages to get this to work, to no avail.
I have a VSFTPD server running on Arch. It works fine EXCEPT that users can navigate up the directory tree and view/download files in other user's home directories. I figure that the answer lies in chroot() but every iteration of the configuration I've tried doesn't work (and yes, I've been restarting the server each time). I'm not sure if the problem lies within the VSFTPD conf or the shell script I use to create new users. I would really appreciate any help with this.
So, here is my conf:
listen=YES
anonymous_enable=NO
dirmessage_enable=YES
chmod_enable=NO
log_ftp_protocol=YES
pasv_enable=YES
pasv_min_port=xxxxx
pasv_max_port=xxxxx
pasv_address=xxx.xxx.xxx.xxx
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=NO
idle_session_timeout=600
data_connection_timeout=120
ftpd_banner=xxxxx xxxxx
pam_service_name=ftp
local_umask=022
chroot_local_user=NO
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.userlist
passwd_chroot_enable=YES
local_enable=YES
write_enable=YES
force_dot_files=NO
tcp_wrappers=NO
userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd.userlist
Here is a shell script I run to create a new user:
#!/bin/sh
mkdir /home/./$1
chmod 775 /home/./$1
useradd -d /home/./$1 -s /bin/false $1
chown -R $1 /home/./$1
passwd $1
echo $1 >> /etc/vsftpd.userlist
echo "FTP user created."