LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-11-2016, 05:30 AM   #1
dudengke
LQ Newbie
 
Registered: May 2016
Posts: 14

Rep: Reputation: Disabled
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
no_anon_password=YES
anon_root=/home/lsb/incoming
Third, I touch a file under the directory /home/lsb/incoming, and runing
Code:
curl ftp://ip(myserver)/text.txt -o text.txt
, it said
Code:
curl: (67) Access denied: 500
But, I can get the a file from linuxfoundation ftp server, for example:
Code:
curl ftp://ftp.linuxfoundation.org/pub/lsb/base/released-all/binary/lsb-setup-4.1.0-1.noarch.rpm -o lsb-setup.rpm
It report successfully.
How can I configure the ftp server without password?
 
Old 07-11-2016, 05:39 AM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
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.
 
Old 07-11-2016, 06:03 AM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Depends on why "access denied" happened.

It may have nothing to do with ftp - check the files ownership/permissions/directory path...
 
Old 07-11-2016, 08:54 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by dudengke View Post
But, I can get the a file from linuxfoundation ftp server, for example:
Code:
curl ftp://ftp.linuxfoundation.org/pub/lsb/base/released-all/binary/lsb-setup-4.1.0-1.noarch.rpm -o lsb-setup.rpm
It report successfully.
How can I configure the ftp server without password?
I can curl a file from my web server...
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?

Last edited by Habitual; 07-11-2016 at 08:57 AM.
 
1 members found this post helpful.
Old 07-11-2016, 05:46 PM   #5
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
You usually can't FTP into the root directory of the server. The highest level directory defaults to
Code:
pub
. So, just use the path you have, but add "/pub/" on then end.
 
Old 07-11-2016, 08:36 PM   #6
dudengke
LQ Newbie
 
Registered: May 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
I can curl a file from my web server...
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?
I want to run some tests on a computer, and download some test files on other computer, so I want to setup a ftp server that can support the download.
 
Old 07-11-2016, 08:37 PM   #7
dudengke
LQ Newbie
 
Registered: May 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post
Depends on why "access denied" happened.

It may have nothing to do with ftp - check the files ownership/permissions/directory path...
The files with
Code:
-rw-rw-rw-
 
Old 07-11-2016, 08:40 PM   #8
dudengke
LQ Newbie
 
Registered: May 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Emerson View Post
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.
OK, thanks, I try the webfs now!
 
Old 07-11-2016, 09:27 PM   #9
dudengke
LQ Newbie
 
Registered: May 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Emerson View Post
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.
I have setup the webfs server, but when I download from the server, it just some HTML file. For example, I have put a xxx.rpm under the directory /var/www,
Code:
curl http://ip(webfs server)//xxx.rpm -o xxx.rpm
The result xxx.rpm is a HTML document, ASCII text.
 
Old 07-12-2016, 03:13 AM   #10
dudengke
LQ Newbie
 
Registered: May 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
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.
 
Old 07-12-2016, 05:35 AM   #11
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Use wget for binary packages.
curl
Code:
wget http://ip/xxx.rpm -o xxx.rpm
should do it.
 
Old 07-12-2016, 05:54 AM   #12
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,631

Rep: Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696
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.
 
2 members found this post helpful.
  


Reply

Tags
ftp, linux command



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
Variables in moving / renaming files using CURL to download Freaksta Linux - Software 3 08-30-2010 09:13 AM
[SOLVED] cURL Download Files from Manifest doby48 Linux - Software 1 06-22-2010 05:52 PM
Perl script to download the files from FTP server peddip Linux - Server 4 03-23-2009 09:49 AM
Can curl download a binary entry from a ldap server ? tclwp Programming 4 07-19-2005 07:57 AM
I want to download ftp-site files via wget and socks5 proxy server. jiawj Red Hat 2 10-28-2004 03:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:35 PM.

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