PDA

View Full Version : file transfer from server 1 to server 3


bschultz
21st February 2008, 06:39
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


ssh user@server2
scp -r /server1directory/ user@server3IP:/server3/path


Any idea what I'm doing wrong?

topdog
21st February 2008, 08:43
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


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

ssh user@server2
scp -r user@server3IP:/server3/path .
scp -r /server1directory/ user@server1:/server1/path
rm -rf /server1directory/

bschultz
21st February 2008, 16:57
thanks a bunch!