An effective solution to ssh connection timeout (ssh usedns option): When logging on to the server via ssh, you always have to wait for a moment before connecting, this is because the OpenSSH server has a DNS search option, UseDNS is enabled by default. When the UseDNS option is enabled, when the client attempts to log on to the OpenSSH server, the server first performs reverse dns ptr query based on the client's IP address to query the client's host name, then, based on the queried client host name, the DNS performs A forward A record query to verify whether it is consistent with the original IP address. This is A method to prevent Client Spoofing, but generally our IP address is dynamic, no PTR record exists. Opening this option is just a waste of time.
Modification Method: www.2cto.com 1. Add UseDNS no configuration in the/etc/ssh/sshd_config configuration file of the server. 2. Restart ssh. /Etc/init. d/sshd restart