Login to Members Area

Choose the service you want to log in
     
24x7x365 Presence
1-888-289-2246
Live Chat

Hosting Blog

 

Slow password prompt while making an SSH connection?

We've seen many times that when someone is trying to make an SSH connection to a server or a Linux machine there is a delay of some seconds or maybe even a minute after inputting the username, root or something else.

The actual reason behind this is that the system is looking up the hostname and the delay lasts as long as it is unable to resolve the hostname.

So to get rid of the lag, there is an option in SSH configuration using which we can stop the SSH daemon from dealing with the hostname resolution and by which we will be able to quickly view the password prompt. That option follows:

vi /etc/ssh/sshd_config

Find what's below in the sshd_config file:

#UseDNS yes

Uncomment the line above and change it to:

UseDNS no

Now save the sshd_config file with the change. Restart the SSHD service as below:

/etc/init.d/sshd restart

After this, you need to attempt again to make an SSH session and you won't face the slowness issue.

Another way is that instead of stopping the process of hostname resolution, make your server's hostname correct and make the entry in the /etc/hosts file and then the daemon will look up the hostname quickly.

That's all.

Sachin Tuesday 03 June 2014 - 07:50 am | | Default

No comments

(optional field)
(optional field)

Comment moderation is enabled on this site. This means that your comment will not be visible until it has been approved by an editor.

Remember personal info?
Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.