Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I make SSH Authentication Lightning Fast?

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.

like image 494
Devon Avatar asked Jun 15 '11 17:06

Devon


2 Answers

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.

like image 51
Devon Avatar answered Sep 30 '22 14:09

Devon


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.

like image 36
Eduardo Costa Avatar answered Sep 30 '22 13:09

Eduardo Costa