LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 06: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, 06:39 AM   #2
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 5,872

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, 07:03 AM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,599

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
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, 09:54 AM   #4
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,158
Blog Entries: 10

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
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 09:57 AM.
 
1 members found this post helpful.
Old 07-11-2016, 06:46 PM   #5
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,829

Rep: Reputation: 256Reputation: 256Reputation: 256
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, 09: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, 09: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, 09: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, 10: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, 04: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, 06:35 AM   #11
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,158
Blog Entries: 10

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
Use wget for binary packages.
curl
Code:
wget http://ip/xxx.rpm -o xxx.rpm
should do it.
 
Old 07-12-2016, 06:54 AM   #12
wpeckham
Senior Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,648

Rep: Reputation: 568Reputation: 568Reputation: 568Reputation: 568Reputation: 568Reputation: 568
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


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


All times are GMT -5. The time now is 10:40 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration