How to disable ssh daemon reverse IP lookups for clients.
By default, sshd will do a ptr lookup for the IP where a client connects from. If the DNS server fails to respond, sshd (or at least older versions) will hang for a long time and most clients will timeout.
Detecting your ssh version:
Code:
~ ssh -V
OpenSSH_4.7p1 FreeBSD-openssh-portable-4.7.p1_1,1, OpenSSL 0.9.8g 19 Oct 2007
If your version is more recent (above4), you can disable ssh reverse lookups by uncommending or adding the following line to
sshd_config file:
Code:
UseDns no
Otherwise, if ssh version is 3 (not the protocol, but software version), uncoment the following line in the same file:
Code:
VerifyReverseMapping No
SSH daemon needs to be restarted so the changes can take effect.