LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-19-2009, 05:00 AM   #1
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Rep: Reputation: 30
having a little trouble with curl and ftp


hi all i've setup an ftp server that has the custom port of 666 but i can get curl to upload a file but if i remove the custom port number and set it to 21 curl will upload the file... have i got the command right?

won't work (couldn't connect to host):

Quote:
for f in *; do curl -T $f -u username:pass ftp://ip:666; done
works:

Quote:
for f in *; do curl -T $f -u username:pass ftp://ip; done

p.s. the ftp server is setup right and has been tested

Last edited by steve51184; 08-19-2009 at 05:02 AM.
 
Old 08-19-2009, 05:37 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
well if it works when you don't use the "custom" port, then clearly there IS no custom port...
 
Old 08-19-2009, 05:49 AM   #3
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Original Poster
Rep: Reputation: 30
wait what? the custom port is one i've set in the config and i've tested that it works but it wont work with curl as i think i've got the iport bit wrong
 
Old 08-19-2009, 08:58 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
How could it be wrong? a url is a url... you know what a hyperlink looks like, and it's nothing to do with the application you're using it with. Unless something is redirecting or blocking traffic or something, it's not listening on that port.
 
Old 08-19-2009, 12:07 PM   #5
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by acid_kewpie View Post
How could it be wrong? a url is a url... you know what a hyperlink looks like, and it's nothing to do with the application you're using it with. Unless something is redirecting or blocking traffic or something, it's not listening on that port.
it is on that port and like i've said i've tested it on other things and it does work but curl wont take the :port bit!
 
Old 08-19-2009, 12:47 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
yes it does. As above, a URL is a URL, a program isn't allowed to treat them differently. mind you you've not shown any debug output, or even normal output from the curl command at all...
 
Old 08-19-2009, 12:55 PM   #7
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Original Poster
Rep: Reputation: 30
here:

Quote:
$ for f in *; do curl -T $f -u username:pass ftp://ip:666; done
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:01:33 --:--:-- 0
curl: (7) couldn't connect to host
 
Old 08-19-2009, 03:01 PM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Well that isn't debugging so you can't explicitly see it's interpretation of the url, but still, I don't know how many more times I can tell you that the command is working just fine. try, for example, running nmap against the box, and seeing what ports are open.
 
Old 08-19-2009, 05:19 PM   #9
steve51184
Member
 
Registered: Dec 2006
Posts: 381

Original Poster
Rep: Reputation: 30
the port is open i've tested it... is there not another way in the command to include the port?
 
  


Reply


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
yum install php-curl trouble wificonnexion Linux - Newbie 7 05-11-2011 12:27 AM
cURL: Server has many IPs, how would I make a cURL script use those IPs to send data? guest Programming 0 04-11-2009 11:42 AM
Upload files to FTP with "curl" angel115 Programming 4 09-13-2007 03:05 AM
select hangup with Curl FTP tbui57 Linux - Kernel 0 01-10-2007 01:30 PM
FTP trouble eweborg Linux - Networking 2 03-04-2002 10:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:05 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