## jueves, 19 de enero de 2017

### SSH Master and slave connections

If you connect often to a server and you need to do simultaneously various tasks (e.g. get files by SFTP or using scp). It is possible to authenticate only one time and use the first session as a tunnel for all the subsequent connections.

Create the file ~/.ssh/config or edit the file by appending these two lines
ControlMaster auto
ControlPath ~/.ssh/control:%h:%p:%r


Now, after the first connection requiring authentication, all the following ones will use the first one as a tunnel and do not require authentication.

The master connection can not be closed until all the slave connections are closed.

Source http://unix.stackexchange.com/questions/2857/ssh-easily-copy-file-to-local-system