SSH Slow Login even with SSHD UseDNS no parameter -

SSH Slow Login even with SSHD UseDNS no parameter

I couldn't understand why on one system it took a few minutes to get the SSH login prompt when connecting to other systems. The other systems all had the UseDNS parameter set to no, which almost always resolves the login prompt delay.

The reason is Ubuntu and perhaps Debian and other distributions /etc/nsswitch.conf file

Edit yours to have the "hosts" line like so (notice that files and dns are the primary resolution choice)

hosts:          files dns mdns4_minimal [NOTFOUND=return] dns mdns4


If the above does not work - disable GSSAPI auth

This permanently caused my slow SSH login problems:

Edit vi /etc/ssh/ssh_config

Disable GSSAPI auth by setting the following line (make sure to uncomment or change the existing line if there is one that says yes):

GSSAPIAuthentication no

I realized what has happening by running -v with SSH, it kept timing out and trying to use GSSAPIAuthentication before trying password, unlike some older systems I have.

I'm sure this is a real annoyance for a lot of people too.


  • How To Create Apache htpasswd file
  • possible SYN flooding on ctid 42131, port 80. Sending cookies. - Solution
  • Linux last command show login by IP instead of hostname
  • Install Windows From a Linux TFTP Server instead of using WDS Solution
  • How To Secure Samba NMBD/SMBD to bind to a specific IP address
  • tftp: client does not accept options - solution if you are using UEFI PXEBoot disable it!
  • Linux how to view video card make and exact model
  • Authentication refused: bad ownership or modes for directory /home/user SSH Public Key Authentication Failed Solution
  • How to Update Linux /usr/share/misc/pci.ids
  • pcimodules and lspci not working alternative solution
  • How to disable Google Fonts in Wordpress
  • Unable to load dynamic library /usr/lib64/php/modules/php_openssl
  • mysqld in Linux hacked
  • W: GPG error: http://archive.debian.org squeeze Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA NO_PUBKEY 64481591B98321F9
  • cannot mount kvm ntfs image
  • h264 DVR security camera footage cannot be played
  • dhcpd.conf how to secure so only known and allowed clients will be given dhcpd IP address leases
  • Thunderbird E-mail List Blank White but e-mails still clickable and viewable
  • css responsive images
  • responsive table without changing much code solution