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.

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

3 Answers 3

up vote 4 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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