SSH Login Slow — Removing Delay

Problem: When I’m trying to log into the remote server via SSH, after I enter the UserName, it takes a lot of time before it displays the Password prompt. How to solve this problem?

Solution: Basically, a long delay during authentication process is caused by “GSS API Authentication method” or/and by “UseDNS” option. The solution is to disable the GSSAPIAuthentication method and to set the UseDNS to “no” on the SSH Server.

Edit SSH Server configuration file:

# vi /etc/ssh/sshd_config

UseDNS: Specifies whether sshd should look up the remote host name and check that the resolved host name for the remote IP address maps back to the very same IP address. The default is “yes”.

Set the UseDNS to “no” as shown below:

UseDNS no

GSSAPIAuthentication: Specifies whether user authentication based on GSSAPI is allowed. The default is “no”.

Set the GSSAPIAuthentication to “no”:

GSSAPIAuthentication no

Restart the OpenSSH server to apply changes

For Fedora/Centos/RHEL etc.:

# service sshd restart

For Debian/Ubuntu/LinuxMint etc.:

# sudo service ssh restart

Now you could connect to your Server with SSH quick as usual.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Start a GUI Application on a Remote Computer using SSH

This article describes how to log into the remote computer (server) using SSH and run a GUI...

SSHPass: SSH Login With Password – Command Line

A password-based authentication is often a default way to connect to a remote host over SSH. But...

Signing Failed: Agent Refused Operation [SOLVED]

While attempting to connect to some server over SSH, you may get the error as follows:...

SSH Fingerprint: Get Fingerprint of SSH RSA Key

The fingerprint is a unique sequence of letters and numbers used to identify the SSH RSA key. It...

SSH: Create Public Key from Private

Usually a public SSH key is generated at the same time as a private key. Unlike a private SSH...