There are two parameters in /etc/ssh/sshd_config in Linux system, which may cause ssh connection to be slow. These are UseDNS and GSSAPIAuthentication. If you encounter slow ssh login, please refer to the following operations:
Edit the configuration file /etc/ssh/sshd_config， vi /etc/ssh/sshd_config to find the UseDNS option. If there are no comments, comment it #UseDNS yes add UseDNS no
Restart the SSH service /etc/init.d/sshd restart
Note: If the client is a Linux system, make sure that the client makes the same changes and is reboot to take it effect.