3

I enabled this in vsftpd.conf

chroot_local_user=YES

chroot_list_enable=YES

chroot_list_file=/etc/vsftpd.chroot_list

user_config_dir=/etc/vsftpd_user_conf

and here is the user set in vsftpd_user_conf dirctory

ftpupload :

local_root=/mnt/upload

But /mnt/upload is mounted from another directory

/mnt/upload on /opt/upload type none (rw,bind)

Here is the list in /mn/upload

rough_images/

shoes-pentland/

vendor-upload/

shooting/

Additional, the shooting/ directory is mounted from another place

/mnt/upload/shooting on /mnt/shooting none (rw,bind)

Now here is the problem.

When I use the ftp client to move the files between the directories but failed .Files can moved between any directories except the shooting one.

The permission is right . I can move any files between this directories successful by using su ftpupload.

It means the vsftpd didn't support the mount bind?


Here is the vsftpd.conf

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=000
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=YES
chown_username=app
xferlog_std_format=NO
log_ftp_protocol=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
user_config_dir=/etc/vsftpd_user_conf
ls_recurse_enable=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
pasv_enable=YES
pasv_max_port=***
pasv_min_port=***
port_enable=YES
pasv_address=***
virtual_use_local_privs=YES
tcp_wrappers=YES

and here is the mtab:

    /mnt/upload /opt/upload none rw,bind 0 0
    /mnt/upload/shooting /mnt/shooting none rw,bind 0 0

all of the permissions under the /mnt/upload are the same:

drwxrwxrwx * ftpupload app

frankyue
  • 31
  • 5
  • I have used vsftd with mount bind before with no issues. Can you verify the permissions are set correctly on ALL of the folders? It sounds like a permission issue –  Feb 23 '12 at 07:21
  • @NicYoung I doubted it may caused by permission issue at first. But I have the write permission when I ssh on the server with the user.I am sure the permission is right. Did you mount the directory like me ? Not mount only one , but any ? – frankyue Feb 23 '12 at 09:05
  • Yes I had many folders mounted under my ftp root directory. I would ensure that your user has write permissions to these mounted folders as well. –  Feb 23 '12 at 14:41
  • @NicYoung yes I login with `ftpupload` username to the server , create new files and move any files between these directories. BTW, I chmod all of the directories with `777` mode. – frankyue Feb 23 '12 at 15:25
  • Ok can you post your `vsftpd.conf` and `/etc/fstab`? Also if you can post the permissions for all of the directories under ftp root. –  Feb 23 '12 at 15:54
  • @NicYoung I updated the post. so can you give me any advice ? – frankyue Feb 23 '12 at 16:45

1 Answers1

0

Are you chrooting the user into /mnt/upload? The problem may be that vsftpd detects /mnt/upload/shooting to be outside the chroot, although I would expect the bind mount to make this work. Try disabling the chroot or chrooting the user to /mnt.

mgorven
  • 30,615
  • 7
  • 79
  • 122