Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Transferring files - from A to C through B. Possible?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
keifir
Tux's lil' helper
Tux's lil' helper


Joined: 10 Jun 2002
Posts: 119
Location: Canada

PostPosted: Sat Jan 31, 2004 9:45 pm    Post subject: Transferring files - from A to C through B. Possible? Reply with quote

Hi,

here's my question. I'd like to transfer files from machine A to machine C with sftp. Here's my problem:
- host A can see B.
- host C can see B.
- host A cannot see C.

So, to transfer files from A to C , i have to go through B. Now i need to transfer large files and I don't have enough room to transfer them all to host B first and then to C.

Is there any way to transfer these files?

Thanx,
keifir
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Sat Jan 31, 2004 10:09 pm    Post subject: Reply with quote

If you can open up ssh tunnels for both connections you can simply pipe it through, or use an intermediate file.
If you have FTP access you may be able to use FXP; this is a sort-of protocol that allows you to control multiple FTP servers/clients from a central one.
Back to top
View user's profile Send private message
jmoeller
Tux's lil' helper
Tux's lil' helper


Joined: 07 Nov 2003
Posts: 114
Location: USA

PostPosted: Sat Jan 31, 2004 10:13 pm    Post subject: Reply with quote

Yep (I tried this out to make sure it works, too):

On A (replace <B> and <C> with their real names, of course):
Code:
$ ssh -L 60022:<C>:22 <B>


This makes it so that any requests you send on A to localhost:60022 will actually get sent by B to C on port 22.

Then, aagain on A:
Code:
$ sftp -oPort=60022 localhost


This will make said connection on localhost:60022, then get translated to C on port 22 (which happens to be what you need for sftp).

Now, you'll get that host key warning for localhost. It should be the same host key for C. Just remove the entry for localhost from .ssh/known_hosts on A after you're through. Have fun! :)

-EDIT-
D'oh! simultaneous entries!
_________________
Cogito sumere potum alterum.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum