Just wanted to post some notes regarding setting up vsftpd on my recently-flashed LEDE router (wr1043nd v. 2) and ask a couple of questions. Thus, this thread.
First, a description of the task. Since my router, which acts as gateway and DHCP server for my LAN, has a USB port, and since I recently found a 16GB USB drive, I decided I should set up the router to act as an ftp server for my little LAN, using the USB drive as the file repository. So I formatted the drive ext4, stuck it into the router's USB port and rebooted, checking to ensure the USB drive had been found and mounted: it was found and got mounted at /dev/sda1. So I loaded the vsftpd package onto the router and set about configuring it.
My aim was to have the ftp server available only to LAN clients, and to allow anonymous logins that would include permissions to both read and write. It was a bit of a challenge to get things set up for that. Though it now works pretty closely to how I'd hoped it would, there is a slight hitch: on logging in to ftp, I have to stipulate, in addition to the IP, the path to a directory that has the needed read/write permissions, since the ftp server will not dump me into that directory on log-in if I stipulate only the IP (think this is related to chrooting, which vsftp uses for security, as explained at
In any case, after appropriately editing /etc/vsftpd.conf, discovering that I'd need to create a sub-directory with the needed read/write permissions as well as stipulating the path to that directory (after the fashion ftp -p 188.8.131.52/ftp-dir), I was able to conduct some reading and writing tests. Those worked fine, although deleting files as an anonymous user was not working. Further searching turned up another option I could place in the configuration file which, after being added, resulted in anonymous users being able to delete files also.
What I believe are the salient portions of my currently-working vsftpd.conf file look as follows:
background=YES listen=YES anonymous_enable=YES local_enable=NO write_enable=YES local_umask=022 check_shell=NO ftpd_banner=Welcome to my FTP service. session_support=NO anon_root=/mnt/sda1/ no_anon_password=YES hide_ids=YES write_enable=YES anon_upload_enable=YES anon_mkdir_write_enable=YES anon_other_write_enable=YES #added to allow anonymous user to delete files
Now, to some testing questions. I created a 100mb file for copying over ftp to the USB drive connected to the router. From a machine on my LAN that hooks to the router by a 20' ethernet cable, it takes about 25 seconds for that file to copy to the USB drive hooked to the router. While I don't foresee that speed causing me problems, it does seem a lot slower than I'd expected: it's much slower than both rated optimal speed for gigabit networks as well being quite a bit slower than optimal write-speed ratings for USB 2 devices (the drive is a USB 2 flash drive). I did repurpose a pretty old cat5 cable for this project and have wondered whether that could affect the ftp transfer speed. My reading indicates that should slow things down a little. Any input here on whether a an ftp transfer speed of 4 megabytes per second seems exceptionally slow under the scenario described? Thanks