I'm using the scp command to copy files from my local machine (ArchLinux) to my server (CentOS 6.5).
But for each scp command a new connection is established and although I'm using SSH keys for authentication the proccess is taking to much time.
So, is there any way to maintain the connection and make multiple transfers over it?
Best Answer
Nobody took the opportunity to complete answer and I didn't find any duplicate, so here we go.
You can set up
~/.ssh/config
, with these options:Then make sure you
mkdir ~/.ssh/controlmasters/
and from that time, your connections tomachine1
will persist for 10 minutes so you can issue more sessions or data transfers during one connection.