Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 04-29-2007, 07:41 AM   #1
LQ Newbie
Registered: Apr 2007
Location: Edinburgh, Scotland
Distribution: Fedora 6
Posts: 2

Rep: Reputation: 0
Smile Anonymous upload to external NTFS harddrive with vsftpd

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:















ftpd_banner=Welcome to Conny's FTP service on BAMBI.









Last edited by ConnyJ; 04-30-2007 at 02:26 AM.
Old 04-29-2007, 09:59 PM   #2
Registered: Apr 2007
Location: Ft Lauderdale, FL
Distribution: Ubuntu, RHEL, CentOS, Fedora
Posts: 33

Rep: Reputation: 15
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.
Old 04-30-2007, 02:25 AM   #3
LQ Newbie
Registered: Apr 2007
Location: Edinburgh, Scotland
Distribution: Fedora 6
Posts: 2

Original Poster
Rep: Reputation: 0
It made the changes and it works great now!

Cheers mate!
Old 02-12-2008, 02:54 PM   #4
LQ Newbie
Registered: Jan 2008
Posts: 7

Rep: Reputation: 0
Can you please post what the new fstab looks like
Old 10-09-2010, 05:02 PM   #5
LQ Newbie
Registered: Oct 2010
Posts: 2

Rep: Reputation: 0

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:
cat /etc/passwd
and found that on my system ftp us userid 14

Then I looked in the groups file to find the id for the ftp group:
cat /etc/group
and found that on my system the ftp group is 50

Next, I looked to see what device name my NTFS volume has:
fdisk -l
on my system, my NTFS volume is shown to be called: /dev/sdc1

So, I created a mount point for it thus (I'm arbitrarily calling it "Store01":
mkdir /mnt/Store01
in /etc/fstab, this line gets the NTFS volume mounted at /mnt/Store01:
/dev/sdc1    /mnt/Store01    ntfs-3g    nls=utf8,auto,user,rw,uid=14,gid=50,umask=0000,defaults 0 0
Note that it is going to belong to user 14, which is ftp on my system, and group 50, which is ftp on my system. VSFTPD requires that anonymous upload directories to belong to ftp:ftp

Now I define a mount point I want to use as my anonymous root:
mkdir /var/ftp
chown root:root /var/ftp
mkdir /var/ftp/pub
chown ftp:ftp /var/ftp/pub
Notice /var/ftp is owned by root:root, and therefore cannot be written to by vsftpd. This is a requirement of vsftpd for a root anonymous directory, that the anonymous root directory not be writable. So, /var/ftp is what I'm going to use as the anonymous root directory.
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:
/mnt/Store01/ftp    /var/ftp/pub    auto    bind 0 0
And finally, in /etc/vsftpd/vsftpd.conf, this line:
Now an anonymous user can upload into the "pub" directory, on the anonymous FTP site. Files uploaded there will appear in /ftp on my NTFS volume.

Last edited by Carman23; 10-09-2010 at 10:06 PM.


anonymous, chmod, externalharddrive, ftp, ntfs3g, upload, vsftpd

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
anonymous users can't upload files-vsftpd dx0r515t Linux - Networking 3 11-21-2012 12:09 AM
anonymous user can not upload file olympic Linux - Newbie 4 01-19-2007 07:39 AM
can't mount external usb ntfs harddrive etienne.navarro Mandriva 1 10-27-2005 12:54 PM
Anonymous upload with vsftpd 1.1.0 Jesus0190 Linux - Software 0 01-04-2003 05:40 PM
anonymous upload with vsftp rachuba Linux - Software 0 12-29-2002 06:39 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:07 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration