The common solution to this problem on the internet is (mainly to modify the configuration file/etc/ssh/sshd_config ):
My system is centos 5.3, SSH connection is very slow, it is Intranet, It is very slow and unbearable, basically it takes nearly one minute to prompt for a password.
Basically, the solution is:
1. Disable reverse DNS resolution.
Usedns No
2. By default, the system has a record that ignores previously logged-on hosts. Opening this record will basically resolve the issue of slow logon.
IgnoreRhosts Yes
Restart the SSH service
Service sshd reload
3. Modify the value of "gssapiauthentication" to "no" (add this configuration option if not, and release it if commented out );
In fact, you can run "ssh-V host" on your own for debugging. The debug information shows where the connection is delayed. My test is in "debug1: unspecified GSS failure. minor code may provide more information "this pause for a while, so I feel that modifying the value of" gssapiauthentication "should be effective, but it turns out that if you do not change the above items, this change still does not work in my system!