How to configure ftp server that other computer can download files from it using curl?
Hi all, I want to setup a ftp server that other computer can download files from it using curl command, but without password just like the linuxfoundation ftp server. My ftp server runing on Ubuntu 14.04
First, I installed the vsftpd: Code:
sudo apt-get install vsftpd Second, I configured the file /etc/vsftpd.conf as the following: Code:
anonymous_enable=YES Code:
curl ftp://ip(myserver)/text.txt -o text.txt Code:
curl: (67) Access denied: 500 Code:
curl ftp://ftp.linuxfoundation.org/pub/lsb/base/released-all/binary/lsb-setup-4.1.0-1.noarch.rpm -o lsb-setup.rpm How can I configure the ftp server without password? |
Why FTP? If this is for download only use HTTP, for instance webfs is very light HTTP server, it can be configured with password, but allows downloads without password by default. You can keep your FTP server running in parallel in case you want to upload something.
|
Depends on why "access denied" happened.
It may have nothing to do with ftp - check the files ownership/permissions/directory path... |
Quote:
I don't know the answer to your query, but if this "other computer" is on your local network, ftp may or may not be the best tool for the job. Why ftp? is a valid Q. What are you really trying to do? |
You usually can't FTP into the root directory of the server. The highest level directory defaults to
Code:
pub |
Quote:
|
Quote:
Code:
-rw-rw-rw- |
Quote:
|
Quote:
Code:
curl http://ip(webfs server)//xxx.rpm -o xxx.rpm |
OK, I try the apache2, just modify the /etc/apache2/sites-enabled/000-default.conf. Set the DocumentRoot to /var/www and put the files under the /var/www.
|
Use wget for binary packages.
curl Code:
wget http://ip/xxx.rpm -o xxx.rpm |
Just as an aside, one of the OLD ftp server packages (or ftp services written in perl or python) might serve better. VSFTP is the Very Secure FTP package, an attempt to lock down a very unsecure protocol. Trying to be Very Secure and allow unlimited download without passwords are contradictory aims.
The modern tools for this are OpenSSH services (sftp) for the server, and something like scp, pscp, or lftp for the client. If you must (and I can see possible good reasons for this) use curl, then a ftp server that does not allow uploads, but allows almost wide-open downloads from a limited folder tree, might make sense. CURL supports tftp protocol (as well as MANY others including sftp), and is pretty easy to set up (and terribly non-secure). One might leverage tftp (which is available in *all distributions) to serve for this purpose. I hope this helps. |
All times are GMT -5. The time now is 01:10 AM. |