Copy files across two SSH connections in one go (OS X, GUI or CLI)

3

Possible Duplicate:
Forward SSH traffic through a middle machine.

I'm currently deploying a web app that requires files be copied to an internal server via a public facing server.

My current workflow looks like this:

  • scp files to publicserver.example.com
  • ssh to publicserver
  • scp files to 10.2.68.10

What I'd really like to do is to copy files to the internal server in one go - either using a GUI, or via the command line.

Any ideas?

Rich Bradshaw

Posted 2010-09-08T19:53:41.767

Reputation: 6 324

Question was closed 2010-09-09T02:26:46.023

3

Set up an alias for the internal server in ~/.ssh/config as in http://superuser.com/questions/107679/forward-ssh-traffic-through-a-middle-machine

– Gilles 'SO- stop being evil' – 2010-09-08T20:06:16.577

Answers

0

Use ssh to forward your port and then make scp use that port:

ssh -L yourport:internal.host:hostport user@publicserver.example.com

Then:

scp yourfile.xxx localhost:/directory -P yourport

I think that should already do the trick. You might want to take a look at man ssh and man scp if I got the arguments in the wrong way.

evnu

Posted 2010-09-08T19:53:41.767

Reputation: 445