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 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"
masegaloeh
  • 18,236
  • 10
  • 57
  • 106
Wrath
  • 111
  • 2
  • Did you `chmod` the directory before or after you mounted it? If before, you only changed the mountpoint's permissions. – Flup Mar 28 '14 at 08:38
  • I used chmod after mounted it, on the shared dir under /var/www/public_ftp. The thing is, my user can create a file in his own PublicFTP directory, and in the /var/www/public_ftp directly on the server. From FTP however, no. – Wrath Mar 28 '14 at 09:42
  • no more tips about what might be going wrong? :( – Wrath Mar 31 '14 at 06:49
  • Anything useful in vsftpd's logs? – Flup Mar 31 '14 at 07:38
  • Added the necessary parts of the log file to the original post. Nothing fancy in my view, but kind of funny how FAIL DELETE for uploading a file. – Wrath Mar 31 '14 at 07:55
  • Still looking for tips what might be going wrong in here, because i honestly have no clue. – Wrath Apr 02 '14 at 12:59

0 Answers0