Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

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 has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

1 Answer 1

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


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.