Anonymous upload to external NTFS harddrive with vsftpd
Hi!
I'am trying to allow anonymous ftp users upload on my extrenal harddrive with vsftpd. I have mounted the external drive via /etc/fstab as you can see below. I have created a mount --bind link in my /pub/bambi to my external harddrive folder where I want the uploads. The external drive is NTFS by the way. The problem is when I connect with a ftp client, it can not follow the "mount --bind link" from the /pub/bambi dir to /media/Files_Ext/pub (CWD /var/ftp/pub/bambi -550 Failed to change directory). I have tried chmod -c 6666 on /pub/bambi. I can not write files to /media/Files_Ext/pub as soon as it is mounted as /var/ftp/pub/bambi when I am logged in as a usual user, but it is possible as root. Suggestions welcome! My etc/fstab: /dev/sda1 /media/Files_Ext ntfs-3g rw,defaults,umask=0000 0 0 #This works fine /var/ftp/pub/bambi /media/Files_Ext/pub none rw,bind,umask=6666 #I have tried without umask and rw options as well as with umask=0000 My vsftpd.conf: anonymous_enable=YES local_enable=YES write_enable=YES local_umask=022 anon_mkdir_write_enable=YES xferlog_enable=YES connect_from_port_20=YES #chown_uploads=YES #chown_username=whoever #xferlog_file=/var/log/vsftpd.log xferlog_std_format=YES #idle_session_timeout=600 #data_connection_timeout=120 #nopriv_user=ftpsecure #async_abor_enable=YES #ascii_upload_enable=YES #ascii_download_enable=YES ftpd_banner=Welcome to Conny's FTP service on BAMBI. #deny_email_enable=YES #banned_email_file=/etc/vsftpd/banned_emails #chroot_list_enable=YES #chroot_list_file=/etc/vsftpd/chroot_list #ls_recurse_enable=YES listen=YES #listen_ipv6=YES pam_service_name=vsftpd userlist_enable=YES tcp_wrappers=YES max_clients=5 max_per_ip=2 anon_max_rate=700 anon_root=/var/ftp |
From the error is doesnt seem like the user "ftp" has permission to view the directory. Try changing ownership for the /var/ftp/pub/bambi folder to "ftp" and set permissions to 0644. Also you will want to add anon_upload_enable=YES to your vsftpd.conf so the anonymous user can upload files not just create folders (anon_mkdir_write_enable=YES).
Hope that helps. |
It made the changes and it works great now!
Cheers mate! |
Can you please post what the new fstab looks like
thanks |
Solved
Hi. I got it working for me. Here are details:
I have an external NTFS Gigabyte drive that I called "Store01". This volume contains a directory called "/ftp". I want anonymous people to upload to what is seen thru FTP as "/ftp/pub", and I want this to actually be /ftp on my NTFS drive. First, vsftpd wants the anonymous root directory to be owned by ftp:ftp So, I looked in the user file to find the id for ftp: Code:
cat /etc/passwd Then I looked in the groups file to find the id for the ftp group: Code:
cat /etc/group Next, I looked to see what device name my NTFS volume has: Code:
fdisk -l So, I created a mount point for it thus (I'm arbitrarily calling it "Store01": Code:
mkdir /mnt/Store01 Code:
/dev/sdc1 /mnt/Store01 ntfs-3g nls=utf8,auto,user,rw,uid=14,gid=50,umask=0000,defaults 0 0 Now I define a mount point I want to use as my anonymous root: Code:
mkdir /var/ftp But /var/ftp/pub is writeable by vsftpd. It appears to anonymous users as a "pub" directory on the FTP site where they can write files. So I add this line to /etc/fstab, which will point /var/ftp/pub (the anonymous writable directory) to the /ftp folder on my NTFS volume: Code:
/mnt/Store01/ftp /var/ftp/pub auto bind 0 0 Code:
anon_root=/var/ftp |
All times are GMT -5. The time now is 06:15 PM. |