I'm trying to configure VSFTPD, for each user to have a PublicFTP directory, since all users are chrooted, but they still need a central FTP dir. I've created this directory in each of the local system users, and created the shared directory in /var/www/public_ftp
with an ownership of "Developers" group and chmodded to 775. Next step was to add the entries in /etc/fstab
. I even restarted the server and the vsftpd service.
When I login to a user from Developers group and create a file in their PublicFTP directory the file is created and shows up under /var/www/public_ftp
; just like as in any other user's PublicFTP directory. Now, if I login via FTP and try to store a file with STOR or even upload, I get permission denied message.
drwxrwxr-x. 2 root Developers 4096 Mar 28 10:49 PublicFTP /home/<user>/PublicFTP
drwxrwxr-x. 2 root Developers 4096 Mar 28 10:49 public_ftp /var/www/public_ftp
groupmems -g Developers --list > the list contains the <user>.
Content of /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
xferlog_std_format=YES
connect_from_port_20=YES
ascii_upload_enable=YES
ascii_download_enable=YES
ls_recurse_enable=YES
listen=YES
pam_service_name=vsftpd
userlist_anble=YES
tcp_wrappers=YES
use_localtime=YES
chroot_local_user=YES
Content of /etc/fstab
/var/www/public_ftp /home/<user>/PublicFTP none bind 0 0
Sample Scenario:
-. Login to the server with .
-. cd /home//PublicFTP
-. touch Hi.txt
-. ls -la
-rw-r--r--. 1 <user> users 0 Mar 28 11:05 Hi.txt
-. cd /var/www/public_ftp -. ls -la
-rw-r--r--. 1 <user> users 0 Mar 28 11:05 Hi.txt
-. Open some FTP application from a client machine and connect to the FTP server.
-. Login with
-. Navigate to PublicFTP
-. directory is empty. Kinda funny since on the server it's clearly visible.
-. Try to copy a file:
An error occured copying a file to the FTP Server. Make sure you have permission to put files on the server.
Details:
200 Switching to binary mode.
227 Entering Passive mode (10,232,118,108,90,133).
553 Could not create file.
The contents of the log file:
Mon Mar 31 09:52:07 2014 [pid 17629] [<user>] OK LOGIN: Client "xxx.xxx.xxx.xxx"
Mon Mar 31 09:52:07 2014 [pid 17634] [<user>] FAIL DELETE: Client "xxx.xxx.xxx.xxx", "/PublicFTP/proxy.txt"