Often through SSH or SCP to connect a bunch of remote host, also is the Linux host, some of them create SSH connection speed is very slow, the connection after the establishment of the operation speed is very normal, it seems that should not be a network cause. The workaround is to view the debug information by using the-v parameter of SSH:
Use Ssh-v to see the details of the connection establishment process, immediately with a very slow to establish a host to try, in a large pile of output information found here to stay the longest:
Debug1:authentications that can Continue:publickey,gssapi-with-mic,password
Debug1:next Authentication Method:gssapi-with-mic
Debug1:unspecified GSS failure. Minor code may provide more information
No Credentials Cache found
Debug1:unspecified GSS failure. Minor code may provide more information
No Credentials Cache found
Debug1:unspecified GSS failure. Minor code may provide more information
Debug1:next Authentication Method:publickey
The original is because of trying a meaningless and will fail the Gssapi-with-mic authentication method wasted Time, open (remote server)/etc/ssh/ssh_config the inside of the gssapiauthentication Yes to no turn it off, you can let SSH directly tries the wonderful PublicKey authentication method.
To disable the comparison of SSH connection time before and after Gssapiauthentication:
View Plaincopy to Clipboardprint?
[Email protected]:~$ time ssh [email protected] Exit
Real 0m18.488s
User 0m0.004s
SYS 0m0.008s
[Email protected]:~$ time ssh [email protected] Exit
Real 0m3.531s
User 0m0.016s
SYS 0m0.000s
To resolve the SSH connection slow (sometimes wait half a minute before the password input prompt) method