By default in Ubuntu (and probably other distributions), when you log into the SSH server, it will do a reverse DNS lookup of the client for security reasons.
That’s fine, but it’s kind of annoying when you don’t have a working reverse DNS for your IP address. Like for all my internal addresses.
To turn it off (thanks to http://ubuntuforums.org/showthread.php?t=577616):
Edit /etc/ssh/sshd_config and add the following line:
UseDNS no
Easy!
UseDNS key requires parameter “yes” or “no” insted of “off”.
@matsu : You’re right. Sorry about that – I’ve fixed it now! Thanks for letting me know.
Just to set the record straight … UseDNS actually doesn’t work for me. I saw this on another forum: add “-u0″ to the sshd command line option. I’ve tried it and it works!.
Here is the relevant section from the sshd manpage:
-u len This option is used to specify the size of the field in the utmp
structure that holds the remote host name. If the resolved host
name is longer than len, the dotted decimal value will be used
instead. This allows hosts with very long host names that over-
flow this field to still be uniquely identified. Specifying -u0
indicates that only dotted decimal addresses should be put into
the utmp file. -u0 may also be used to prevent sshd from making
DNS requests unless the authentication mechanism or configuration
requires it. Authentication mechanisms that may require DNS
include RhostsRSAAuthentication, HostbasedAuthentication, and
using a from=”pattern-list” option in a key file. Configuration
options that require DNS include using a USER@HOST pattern in
AllowUsers or DenyUsers.