slow ssh connections
(5 September 2019)
Problem
When I ssh login to a CentOS 7 system, it always takes around 30 second to log in.
Solution
Turn off the authentication types you don't need in /etc/ssh/sshd_config :
useDNS no
ChallengeResponseAuthentication no
KerberosAuthentication no
GSSAPIAuthentication no
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
With this configuration, the ssh server should still accept both interactive passwords and ssh pubkeys.
Details
Found )here. In my highly specific case, disabling GSSAPIAuthentication made the difference between a 50 second wait to log in and a sub-1-second wait to log in.