Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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

This question was marked as an exact duplicate of an existing 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
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.

share|improve this answer

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