1

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 upload a file to the PublicFTP folder, 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 .

/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
/etc/fstab:
/var/www/public_ftp    /home/<user>/PublicFTP    none    bind    0 0

Sample Scenario

  1. Login to the server and touch a file.

    $ cd /home/<user>/PublicFTP
    $ touch Hi.txt
    $ ls -la
    -rw-r--r--.  1 <user> users 0 Mar 28 11:05 Hi.txt
    
  2. Confirm on the server side.

    $ cd /var/www/public_ftp
    $ ls -la
    -rw-r--r--.  1 <user> users 0 Mar 28 11:05 Hi.txt
    
  3. Open some FTP application from a client machine and connect to the FTP server and login.

  4. Navigate to PublicFTP directory is empty. Kinda funny since on the server it's clearly visible.

  5. Try to copy a file. An error occurred 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.
    
  6. 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"
    
  • that's the entire log? I don't buy it. don't clip things to be "helpful", especially not logs. – strugee Apr 8 '14 at 10:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.