ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Slow SSH Logins on Linux

    Scheduled Pinned Locked Moved IT Discussion
    linuxcentoscentos 6rhel 6rhel 6.7sshd
    2 Posts 2 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by

      Often remote SSH logins on Linux can experience a lengthy delay. This is often caused by the SSH daemon on the server defaulting to attempting a DNS lookup of the SSH client attempting to connect to it. Typically we do not want this behaviour as client systems often cannot be verified in this manner but awaiting a DNS timeout can be rather annoying. Many systems configure this on by default. I see this in the Red Hat family including RHEL, CentOS, etc.

      The fix is simple, just explicetly add the line:

      UseDNS no
      

      To the /etc/ssh/sshd_config configuration file. The default is “yes” and there should be a comment to this effect as well. After making the change, simply restart the SSH daemon for the change to take effect.

      service sshd restart
      

      Originally found in 2012 on my Linux blog here: http://web.archive.org/web/20140822224153/http://www.scottalanmiller.com/linux/2012/09/02/slow-ssh-logins/

      stacksofplatesS 1 Reply Last reply Reply Quote 3
      • stacksofplatesS
        stacksofplates @scottalanmiller
        last edited by

        @scottalanmiller said in Slow SSH Logins on Linux:

        Often remote SSH logins on Linux can experience a lengthy delay. This is often caused by the SSH daemon on the server defaulting to attempting a DNS lookup of the SSH client attempting to connect to it. Typically we do not want this behaviour as client systems often cannot be verified in this manner but awaiting a DNS timeout can be rather annoying. Many systems configure this on by default. I see this in the Red Hat family including RHEL, CentOS, etc.

        The fix is simple, just explicetly add the line:

        UseDNS no
        

        To the /etc/ssh/sshd_config configuration file. The default is “yes” and there should be a comment to this effect as well. After making the change, simply restart the SSH daemon for the change to take effect.

        service sshd restart
        

        Originally found in 2012 on my Linux blog here: http://web.archive.org/web/20140822224153/http://www.scottalanmiller.com/linux/2012/09/02/slow-ssh-logins/

        Ran into this the other day. Windows to Linux was pretty slow, but Linux to Linux (using our Bind server) was super fast. Turned off DNS and GSSAPI and it was fine from Windows.

        1 Reply Last reply Reply Quote 1
        • 1 / 1
        • First post
          Last post