Solve the problem of slow ssh login and long waiting time

Original address: https://blog.csdn.net/sinat_34439107/article/details/79057373

related articles

1. The solution to the slow ssh connection---- https://blog.csdn.net/w892824196/article/details/80948958

2. SSH login is very slow. Solution ---- https://www.linuxprobe.com/ssh-login-slowly.html

3, SSH connection the problem of slow analysis ---- https://www.cnblogs.com/atwo/p/9430566.html

 

Transfer from: http://blog.csdn.net/kanghaha/article/details/51986771

Sometimes when SSH remotely logs in to other hosts, I find that the login time is too long. After personal testing, I found that there are two main problems that can cause ssh login slow:

1. Use dns reverse check, so when ssh a certain IP, the system will try to reverse check the corresponding domain name through DNS, if there is no domain name resolution of this IP in DNS, it will wait until DNS query timeout before proceeding to the next step , Consumes a long time.

Modification method:

Use root authority to modify the ssh configuration file, vim /etc/ssh/sshd_config

Add a line of record: UseDNS no

By default, there will be a commented out record #UseDNS yes. Although this record is commented out, the value of UseDNS by ssh is yes by default, so the value must be explicitly specified as no.

Restart the ssh service

#service sshd restart

2. This situation is more obvious when the local host or remote host starts graphics. This parameter seems to be for graphics authentication. The specific function is not clear, but the modification can significantly improve the ssh remote login speed.

vim /etc/ssh/sshd_config

Modify the GSSAPIAuthentication parameter to no, the default is yes

 

Restart the ssh service

#service sshd restart

 

 

Guess you like

Origin blog.csdn.net/xqhrs232/article/details/113366451