LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-27-2013, 02:16 AM   #1
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Rep: Reputation: 55
ftp a file directly from a 3-rd machine?


Dear Slackers, this is not Slackware-specific question, but I am sure
somebody will be able to get me the answer.

So, let my machine be A, a Linux Server be B, and an ftp server be C.
Code:
A  -  B  -   C, 
  ssh    ftp
A connects to B via ssh, and B to C via ftp. A cannot directly connect to C.
Can I download a file from C directly to A without saving it on B's hard drive?

Best regards,
Martin
 
Old 06-27-2013, 02:47 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Sorry I'm not a slackware fan, hope it's OK answering you question...

FTP is hard to tunnel as it's an archaic protocol, but using ssh as a SOCKS proxy you should be OK. There's a guide here, that I found on google in 5 seconds

http://www.styryx.com/en/computers/s...eling-over-ssh
 
Old 06-27-2013, 03:01 AM   #3
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Try "man lftp" and scroll down to the "get" command explanation. One of the examples is what you want to do.
 
Old 06-27-2013, 05:11 AM   #4
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Original Poster
Rep: Reputation: 55
Thank You for the replies.
@Richard Cranium: Unfortunately there is no lftp on machine B, so I think there is no way to get this method to work for my problem
@acid_kewpie: I read the tutorial, but I can only use the command line. And the explanation for the command line there is vague, could you provide some sample commands?
 
Old 06-27-2013, 05:32 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
from an ssh command, you'd just use the -D <port no> option instead of the Dynamic radio button on PuTTY. The rest should be logical equivalent.
 
Old 06-27-2013, 06:41 AM   #6
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by acid_kewpie View Post
from an ssh command, you'd just use the -D <port no> option instead of the Dynamic radio button on PuTTY. The rest should be logical equivalent.
After spending 2 hours without success on this, I've given up
 
Old 06-27-2013, 07:37 AM   #7
WhiteWolf1776
Member
 
Registered: Oct 2010
Location: Bowling Green, KY
Distribution: Slackware
Posts: 288

Rep: Reputation: 95
well, yes... there is a fairly simple way.. but you need an additional piece of software on B.

http://slackbuilds.org/repository/14...rk/sshfs-fuse/

you install this, and mount a folder on system A from system B... then you ftp from C to that folder on B (which really pushes it to A as that's where the folder is)

not sure if that is exactly what you were going for, but I've been using this to push files all over the network here without needing to do more than mount the folders and cp.
 
Old 06-27-2013, 08:04 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
oh yeah, that's not a bad trick if you can install the software on the MITM box
 
Old 06-27-2013, 09:15 AM   #9
NeoMetal
Member
 
Registered: Aug 2004
Location: MD
Distribution: Slackware
Posts: 114

Rep: Reputation: 24
If the ftp client on B can write to stdout you could probably do the equivalent of the ssh tar pipe

ssh user@B 'tar zcf - stuff' | tar zxf -

from A, but instead of tar, run the remote ftp process and pipe it a local cat or something pointing into a file, or leave the tar's and add an ftp in the remote command in front of and piping into the tar

something like

ssh user@B 'curl ftp://serverC.local/file' > localcopy.file




http://linux.icydog.net/ssh/piping.php

Last edited by NeoMetal; 06-27-2013 at 07:45 PM.
 
Old 06-27-2013, 06:36 PM   #10
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
Yes, in fact ncftpget would be ideal for this.

Code:
ssh user@B 'ncftpget -c ftp://serverC/pub/somefile.bz2' > somefile.bz2
 
  


Reply



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
Can KVM access a Hyper-V virtual machine directly Nick_C Linux - Virtualization and Cloud 4 03-05-2012 10:12 AM
ftp_fget problems grabbing text data from ftp file on LINUX machine nuebelhor Red Hat 1 10-12-2009 04:15 AM
How can I connect a linux box to a WIN. XP (pro) machine directly? magesing Linux - Networking 3 08-16-2006 07:16 PM
sending mail directly to another machine on the local network? lmcilwain Fedora 3 06-27-2006 01:48 PM
Watching movies (saved on a linux machine) on my TV directly (without burnung)? GSX Linux - General 6 07-01-2005 02:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:49 AM.

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