Sunday, August 24, 2008

Tip to speed up new ssh connections

Initial connections via ssh can take a fair bit of setup - especially if you are going over a high latency link like GPRS - if you already have a connection then you can use the existing channel/socket for reauth. To do this put this in either the specific connection for the particular host in your ~/.ssh/config file or do it for all connections ala:

Host *<br />  ControlMaster auto<br />  ControlPath ~/.ssh/socket.%r@%h:%p<br />



Now its possible that if you lose your ssh connection then you might have kill this socket - you could kill the ssh process or you could have an alias for this:

ssh -S “${control_socket}” -O exit “${REMOTE_HOST}”

No comments: