LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   ftp a file directly from a 3-rd machine? (https://www.linuxquestions.org/questions/slackware-14/ftp-a-file-directly-from-a-3-rd-machine-4175467548/)

tramni1980 06-27-2013 02:16 AM

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

acid_kewpie 06-27-2013 02:47 AM

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

Richard Cranium 06-27-2013 03:01 AM

Try "man lftp" and scroll down to the "get" command explanation. One of the examples is what you want to do.

tramni1980 06-27-2013 05:11 AM

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?

acid_kewpie 06-27-2013 05:32 AM

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.

tramni1980 06-27-2013 06:41 AM

Quote:

Originally Posted by acid_kewpie (Post 4979516)
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

WhiteWolf1776 06-27-2013 07:37 AM

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.

acid_kewpie 06-27-2013 08:04 AM

oh yeah, that's not a bad trick if you can install the software on the MITM box

NeoMetal 06-27-2013 09:15 AM

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

mRgOBLIN 06-27-2013 06:36 PM

Yes, in fact ncftpget would be ideal for this.

Code:

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


All times are GMT -5. The time now is 02:34 AM.