SSH login is too slow (wait a long time before prompted for a password) problem

SSH login may be too slow DNS resolution problem, accept the default configuration when ssh sshd first client connection will automatically reverse lookup IP client ssh client to get the domain name or host name.

If this time the DNS reverse lookup is not correct, sshd will wait until a timeout provide DNS resolution ssh connection, thus causing the connection time is too long, the situation ssh client waiting, usually about 10-30 seconds. There is a simple solution is to remove sshd reverse DNS resolution in the sshd configuration file (sshd_config) years.

#编辑sshd_config
vim /etc/ssh/sshd_config 

将 #UseDNS yes改为  UseDNS no  

#重启sshd
systemctl restart sshd
Published 130 original articles · won praise 379 · views 470 000 +

Guess you like

Origin blog.csdn.net/qq_31122833/article/details/102741906