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?

link|improve this question

3  
Set up an alias for the internal server in ~/.ssh/config as in superuser.com/questions/107679/… – Gilles Sep 8 '10 at 20:06
feedback

closed as exact duplicate by Rich Bradshaw, random Sep 9 '10 at 2:26

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

1 Answer

up vote 0 down vote accepted

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.

link|improve this answer
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.