Reputation: 5784
I use SSH in a terminal window many times during a day.
I remember reading about a way to reuse a single connection so that the TCP and SSH handshaking don't have to happen every time I establish another request to the same host.
Can someone point me to a link or describe how to establish a shared ssh connection so that subsequent connections to the same host will connect quickly?
Thanks.
Upvotes: 9
Views: 4712
Reputation: 5784
Answering my own question. Improving SSH (OpenSSH) connection speed with shared connections describes using the "ControlPath" configuration setting.
UPDATE: For connections that are opened and closed often add a setting like ControlPersist 4h
to your ~/.ssh/config. See this post about SSH productivity tips.
Upvotes: 12
Reputation: 1994
If you want to keep the terminal opened, the easiest way is producing I/O ("tail -f" or "while [ -d . ]; cat /etc/loadavg; sleep 3; done").
If you want to improve the connection handshake one way I use is adding "UseDNS no" on your sshd_config.
Upvotes: 2