Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 21st February 2008, 05:39
bschultz bschultz is offline
Senior Member
 
Join Date: Jul 2006
Posts: 221
Thanks: 11
Thanked 10 Times in 10 Posts
Default file transfer from server 1 to server 3

I have a problem. The setup I'm dealing with at work is a router and firewall on the main server (Mac OS X) with ssh. I need to send (via cron job) a directory from my linux server at home to a second machine at work (also Mac OS X)...not the main server.

So, what I need is this:

server1 ssh's into server2 which ssh's into server3 and sends the directory. My boss won't let me change the firewall or port forwarding settings to ssh directly into server3.

I've tried to ssh into server 2 (main server/router) and then ssh into server3 and then scp the files...but I get an "ambiguous target" error.

Here's my code

Code:
ssh user@server2
scp -r /server1directory/ user@server3IP:/server3/path
Any idea what I'm doing wrong?
Reply With Quote
Sponsored Links
  #2  
Old 21st February 2008, 07:43
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

Quote:
Originally Posted by bschultz
I have a problem. The setup I'm dealing with at work is a router and firewall on the main server (Mac OS X) with ssh. I need to send (via cron job) a directory from my linux server at home to a second machine at work (also Mac OS X)...not the main server.

So, what I need is this:

server1 ssh's into server2 which ssh's into server3 and sends the directory. My boss won't let me change the firewall or port forwarding settings to ssh directly into server3.

I've tried to ssh into server 2 (main server/router) and then ssh into server3 and then scp the files...but I get an "ambiguous target" error.

Here's my code

Code:
ssh user@server2
scp -r /server1directory/ user@server3IP:/server3/path
Any idea what I'm doing wrong?
I think it should be the other way round
Code:
ssh user@server2
scp -r user@server3IP:/server3/path .
scp -r /server1directory/ user@server1:/server1/path
rm -rf /server1directory/
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
The Following User Says Thank You to topdog For This Useful Post:
bschultz (21st February 2008)
  #3  
Old 21st February 2008, 15:57
bschultz bschultz is offline
Senior Member
 
Join Date: Jul 2006
Posts: 221
Thanks: 11
Thanked 10 Times in 10 Posts
 
Default

thanks a bunch!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Statistic not working mzo Installation/Configuration 49 20th April 2011 12:19
directories in /home/admispconfig/ispconfig renamed? Spudchat General 10 12th April 2007 19:37
spamassasin/clamAV not working Daisy Installation/Configuration 32 15th February 2007 00:09
Systemimager (rsync) doesn't copy all comedit HOWTO-Related Questions 11 19th January 2007 17:17
HotSaNIC domino Tips/Tricks/Mods 23 6th November 2006 05:19


All times are GMT +2. The time now is 02:27.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.