ssh login taking too long

Posted on

ssh login taking too long – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, ssh, , , .

I have a hardware which is flashed with the following operating system :
Linux colibri 2.6.26-colibri_pxa3xx #14
I have noticed that the ssh login as well as telnet takes too long, even though I try to login from the same subnet.

I do not see any unusual messages being logged in the /var/log/messages

I tried ssh -vvv and I can see that the delay is mainly due to the fetch in the remote protocol version. I have 2 identical machines flashed with the same OS and the behaviour occurs in one and not the other.
The lag i see is a considerable delay in fetching and displaying this message.

debug1: Remote protocol version 2.0, remote software version dropbear_0.49

Solution :

First, to collect more info about the delay try connecting with verbosity enabled: ssh -vvv user@hostname.
Second, try disabling the reverse DNS lookup – edit /etc/ssh/sshd_config on your device and setup UseDNS no. Restart the service and check again.
Third, setup GSSAPIAuthentication no in the same file, restart the service and retry.

Here you can see a good example, I used it in the past.

Try putting UseDNS no in /etc/ssh/sshd_config and restart ssh.
You may also want to add an entry to /etc/hosts for the machine you are trying ssh into.

I had a similar issue connecting to my DC. Try to alter the MTU settings of the sshd server to a value less than 1500. Worked for me.

Leave a Reply

Your email address will not be published.