Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I have a high latency connection to a remote system. I'm debugging a script on the remote system, and thus repeatedly copying a small file via scp.

This is annoying because it has to re-authenticate (using pubkey) each time and the whole process takes longer than it should.

Is there a port forward or something I can set up would make the copy bypass authentication? Is there a recipe for this?

share|improve this question
up vote 5 down vote accepted

You could enable connection sharing. You would keep a single connection open (e.g. use it for work on the remote site) and use that same connection to copy with scp.

To activate it you need in your ~/.ssh/config

Host *
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p

ControlPath is the path to the socket for the shared connection. Above example creates a dynamic name from login and hostname.

share|improve this answer
+1 Excellent, that's exactly what I needed. Thanks. – bstpierre Sep 9 '10 at 16:06

Despite the good answers already given (in fact this extends the answer on sftp): Using sshfs (using FUSE) to mount the remote working directory onto your local machine is also a nice transparent solution: sshfs [user@]host:[dir] mountpoint [options] and `fusermount -u mountpoint to unmount).

share|improve this answer

Using SFTP (via sftp) will allow you to hold the connection open and transfer as many times as needed provided the server has the SFTP subsystem enabled.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .