0

SSH slow login

If SSHing to your VPS is slow especially during the login stage then this could be down to UseDNS being switched on in your sshd_config file. In order to speed up the login process and improve overall responsiveness of your SSH session it is necessary to switch UseDNS off. In order to do this please do the following:

  1. SSH into your VPS.
  2. If your using a Debian based linux distro type in
    nano /etc/ssh/sshd_config

    and press enter. Otherwise please refer to the documentation for your particular linux distro. To find your distro from the command line please see my post here.

  3. In sshd_config look forĀ UseDNS yes and replace with UseDNS no.
  4. If the line doesn’t exist at all, add UseDNS no to the end of the file.
  5. Press ctrl+x to close and press Y to Save sshd_config.
  6. Restart the SSH daemon and you’re good to go.
    sudo /etc/init.d/ssh restart

SSH responsiveness should improve dramatically. For more information regarding sshd_config please refer to it’s man page here.

Jason Edwards